• Stars
    star
    137
  • Rank 266,121 (Top 6 %)
  • Language
    C#
  • License
    Apache License 2.0
  • Created almost 4 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Unity implementation of Decentraland Client

Decentraland Unity Renderer

This repository contains the reference implementation of the decentraland explorer. It includes two main big components, located in the folders:

  • unity-renderer which contains the main 3D experience and UI
  • browser-interface to connect to the different aspects requiring of a web browser, such as connection with a wallet and WebRTC communications

Running the Explorer

Main Dependencies

  • Install images and binary files using git lfs (git-lfs.github.com). These can be installed from bash or PowerShell by typing:

    git lfs install git lfs pull

  • The Unity engine and IDE, currently using version 2021.3.14f1

  • node.js, version 16 or later

Steps

Check: Multiplatform in Editor

  1. Download and install Unity 2021.3.14f1
  2. Open the scene named InitialScene
  3. Within the scene, select the DebugConfig GameObject.
  4. On DebugConfig inspector, make sure that Base url mode is set to Custom and Base url custom is set to https://play.decentraland.zone/?
  5. Run the Initial Scene in the Unity editor
  6. A browser tab with explorer should open automatically and steal your focus, don't close it! Login with your wallet, go back to Unity and explorer should start running on the Game View.
  7. As you can see, DebugConfig has other special options like the starting position, etc. You are welcome to use them as you see fit, but you'll have to close the tab and restart the scene for them to make effect.

Troubleshooting

Missing git lfs extension

If while trying to compile the Unity project you get an error regarding some libraries that can not be added (for instance Newtonsoft Json.NET or Google Protobuf), please execute the following command in the root folder:

git lfs install
git lfs pull

Then, on the Unity editor, click on Assets > Reimport All


Testing your branch using automated builds

To test against a build made on this repository, you can use a link with this format:

https://play.decentraland.zone/?explorer-branch=<branch-name>

Links for Contributors

  1. Contribution Guidelines
  2. Coding Guidelines
  3. Code Review Standards
  4. Architecture

Advanced debugging scenarios

Running the browser-interface

In order to run browser interface in any platform follow the next instructions

How to run make watch

  1. Open browser-interface with Visual Studio Code
  2. Make sure you have the devcontainers extension installed
  3. Make sure Docker Desktop is running
  4. At Visual Studio Code press F1 execute Reopen in Container and wait for it to finish.
  5. Go to Terminal > New Terminal menu and run make watch command.

How to run browser-interface unit tests

  1. Follow the previous process to run make watch
  2. Open localhost:8080/test in your browser
  3. Watch the results

Debug with Unity Editor + local Browser Interface

Use this approach when working on any features that need both Browser Interface and Unity modifications, and you need to watch Unity code changes fast without the need of injecting a wasm targeted build in the browser.

When the steps are followed, you will be able to test your changes by just pressing the "Play" button within Unity. This will open a tab running the local Browser Interface build and Unity will connect to it using websocket.

This is the most useful debugging scenario for advanced feature implementation.

Steps

  1. Make sure you have the proper Unity version up and running
  2. Make sure you are running browser-interface through make watch command on browser-interface path.
  3. Back in unity editor, open the DebugConfig component inspector of InitialScene
  4. Make sure that the component is setup correctly
  5. Hit 'Play' button

Debug with browsers + local Unity build

This approach works when your Unity modifications run well in the wasm targeted unity build, but you don't want to wait for the CI to kick in. This is also useful for remote profiling.

When the steps are followed, you will be able to run the local Unity build by going to localhost:3000 without the need of CI.

Steps

  1. Make sure you have the proper Unity version up and running
  2. Make sure you are running browser-interface through make watch command.
  3. Produce a Unity wasm targeted build using the Build menu.
  4. When the build finishes, copy all the files inside the resulting /build folder (unity.loader.js is not necessary as we use a modified loader) and paste them inside browser-interface/node_modules/@dcl/unity-renderer.
  5. Run the browser explorer through localhost:8080&ENABLE_WEB3. Now, it should use your local Unity build. Don't mind the white screen at the beginning, that's because the website repo is not being used and it's only loading Browser Interface with the build.
  6. If you need a Unity re-build, you can just replace the files and reload the browser without restarting the make watch process.

Alternatively you can go through these 2 steps after step 3 and load the build locally using localhost:3000

  1. Make sure you have the explorer website repository cloned.
  2. Make sure you have the local website up and running by executing npm run start:linked in the cloned repo directory (npm i first just in case).
  3. When the WebGL build finishes, copy all the files inside the resulting /build folder (unity.loader.js is not necessary as we use a modified loader) and paste them inside explorer-website/node_modules/@dcl/unity-renderer.
  4. Access using localhost:3000

Troubleshooting

MacOS: Missing xcrun

If you get the "missing xcrun" error when trying to run the make watch command, you should download the latest command line tools for macOS, either by downloading them from https://developer.apple.com/download/more/?=command%20line%20tools or by re-installing XCode

MacOS: Build fails throwing System.ComponentModel.Win32Exception (2): No such file or directory...

If the local WebGL build always fails with the error System.ComponentModel.Win32Exception (2): No such file or directory... it's because you are missing Python needed version (MacOS 12.3 onwards removes the previously-integrated python installation). So to solve this issue just install this Python version.

Frameworks and Tools

Technical how-to guides and explainers

Setup CircleCI

Setup CircleCI

Copyright info

This repository is protected with a standard Apache 2 license. See the terms and conditions in the LICENSE file.

More Repositories

1

marketplace

πŸ›οΈ Decentraland's NFT Marketplace
TypeScript
1,025
star
2

dappeteer

πŸŒπŸΌβ€E2E testing for dApps using Puppeteer + MetaMask
CSS
240
star
3

ui

πŸ¦„ Decentraland UI
TypeScript
204
star
4

marketplace-contracts

πŸ”– Decentraland Marketplace Contracts
JavaScript
158
star
5

mana

⏣ Solidity Contracts for the Decentraland MANA Token
Solidity
148
star
6

builder

πŸ‰ Build scenes for Decentraland
TypeScript
144
star
7

marketplace-legacy

πŸ›οΈ Decentraland's LAND Marketplace
JavaScript
126
star
8

land

β›° Contract for LAND
Solidity
117
star
9

districts

Proposals for Community Districts for the Terraform event
115
star
10

decentraland-dapps

πŸ›  Common modules for dApps
TypeScript
108
star
11

bronzeage-node

DEPRECATED: This codebase will not be mantained anymore, and formats are going to change when we move to the Decentraland Iron Age
JavaScript
104
star
12

erc721

πŸ“œ Distinguishable Assets Registry (ERC 721)
JavaScript
94
star
13

avatar-assets

πŸ‘” Collection of 3D models for Decentraland avatars
TypeScript
85
star
14

explorer

🌎 Explore Decentraland from a web browser
TypeScript
79
star
15

cli

πŸ’» Decentraland command-line interface
TypeScript
67
star
16

wearables-contracts

πŸ“œ 🎭 Set of Wearables NFT contracts
JavaScript
62
star
17

ethalarm

⏰ Get notifications whenever an Ethereum smart contract triggers an event.
JavaScript
57
star
18

bronzeage-editor

DEPRECATED: Unity editor and browser for Decentraland Bronze Age
C#
57
star
19

editor-legacy

πŸ“ Collaborative real-time edition of parcel scenes, with IPFS uploading. Based on aframe-inspector
JavaScript
54
star
20

catalyst

🐧 Content server for Decentraland
TypeScript
52
star
21

governance

🏒 Governance platform of the Decentraland DAO
TypeScript
45
star
22

proposals

Review of community proposals for Decentraland's art and applications
45
star
23

eth-connect

πŸ”Œ Ethereum connector for Decentraland scenes and applications
TypeScript
43
star
24

old-documentation

πŸ“– What is Decentraland?
HTML
41
star
25

js-sdk-toolchain

Toolchain to build JS & TS scenes for Decentraland
TypeScript
37
star
26

explorer-desktop

Desktop client for Decentraland, coming soon
C#
35
star
27

sample-scenes

πŸ— Examples of different experiences built for Decentraland
32
star
28

decentraland-ecs-utils

TypeScript
32
star
29

stoneage-browser

πŸ₯‰ Browser for Decentraland Stone Age
JavaScript
32
star
30

auction

πŸŒ… Source code for Decentraland's Terraform Auction
JavaScript
31
star
31

webrtc-broker

πŸ”ŒWebRTC message broker
Go
25
star
32

ipfs-node

πŸ’½ A proxy to connect to the IPFS network
JavaScript
24
star
33

contracts

πŸ“ Decentraland contract addresses
HTML
24
star
34

architecture

This repository aims to have the main Decentraland Architecture
Makefile
22
star
35

stoneage-node

Node for Decentraland Stone Age
JavaScript
22
star
36

builder-server

Builder app backend
TypeScript
21
star
37

adr

Architecture Decisions Records
SCSS
21
star
38

kernel-legacy

🌎 Explore Decentraland from a web browser
TypeScript
20
star
39

smart-items

πŸ’‘Smart item examples
TypeScript
19
star
40

atlas-server

πŸ—Ί A server for the atlas map
TypeScript
19
star
41

kernel

Kernel is the glue code between the OS, comms and the Renderer of Decentraland
TypeScript
19
star
42

builder-assets

🎲 Builder asset packs
TypeScript
18
star
43

nft-server

NFT Server
TypeScript
18
star
44

issues

Main entry point for user's feedback
17
star
45

decentraland-commons

πŸ›  Set of common functionality across Decentraland projects.
TypeScript
17
star
46

dapp-boilerplate

Decentraland's ÐApps Boilerplate
JavaScript
17
star
47

decentraland-l2-utils

TypeScript
17
star
48

decentraland-npc-utils

NPC tools for conversational NPCs
TypeScript
16
star
49

agora

πŸ“Agora is an off-chain governance tool for decentralized communities.
TypeScript
16
star
50

decentraland-ui-utils

TypeScript
16
star
51

decentraland-eth

DEPRECATED - Ethereum common helpers for Decentraland
TypeScript
15
star
52

ecs-reference

ECS API Reference
JavaScript
15
star
53

nft-schema

Open API Specification for the NFT APIs
TypeScript
13
star
54

explorer-desktop-launcher

TypeScript
13
star
55

decentraland-gatsby

Opinionated All-in-one Web Framework
TypeScript
11
star
56

decentraland-crypto-utils

TypeScript
11
star
57

MANA-community-fund-learning-content

Offer bounties in MANA to developers that create educational content: tutorials & scene samples
TypeScript
11
star
58

catalyst-owner

Everything necessary for catalyst owners to deploy their own node
Shell
11
star
59

avatars-contract

Avatars smart contract
Solidity
11
star
60

l2-airdrop

Collection of command line tools to do massive Airdrops of Decentraland Wearables on Matic
TypeScript
10
star
61

documentation

Mathematica
9
star
62

gate

πŸšͺ Manage invitations to access the client
JavaScript
9
star
63

sdk7-goerli-plaza

TypeScript
9
star
64

sdk7-scene-template

ECS 7 Template
TypeScript
9
star
65

godot-explorer

Rust
9
star
66

bid-contract

JavaScript
8
star
67

unity-explorer

JavaScript
8
star
68

rentals-contract

TypeScript
8
star
69

tile-map

πŸ—Ί Tile Map
TypeScript
8
star
70

land-auction

Contracts for the LAND auction
Solidity
8
star
71

catalyst-client

A client to query and perform changes on Decentraland's catalyst servers
TypeScript
7
star
72

matrix-client

πŸ“‘ Interact with Decentraland's users, send private messages and add friends.
TypeScript
7
star
73

explorer-website

This is the repository for the website served in play.decentraland.org
TypeScript
7
star
74

rendezvous

πŸ“ž WebRTC Signalling Server that uses Server-Sent Events
JavaScript
7
star
75

decentraland-connect

Connect your Ethereum wallet from different providers
TypeScript
7
star
76

collections-graph

🎽 Decentraland Collections Graph
TypeScript
7
star
77

decentraland-server

Set of common functionality accross Decentraland projects servers
TypeScript
6
star
78

canilla

🚰 Faucet for all things related to Decentraland
JavaScript
6
star
79

catalyst-api-specs

API definition for the Catalyst Server implementation
TypeScript
6
star
80

web

Decentraland websites
CSS
6
star
81

transactions-server

Proxy server that relays transactions to Biconomy, using some restrictions
TypeScript
6
star
82

wearable-preview

Render an interactive preview of a wearable
TypeScript
6
star
83

protocol

Shell
6
star
84

rpc-rust

Decentraland RPC - Rust implementation
Rust
6
star
85

events

This website hosts a dApp used to upload and see what others are organizing inside the Decentraland virtual world.
TypeScript
6
star
86

decentraland-rpc

πŸ“‘ Sandboxed code execution + Plugins + JSON-RPC engine
TypeScript
6
star
87

standards

πŸ“œ At Decentraland, we put a lot of effort into improving both the Software itself and the Software Process. The pillars of the Software Process are the standards we define to organize our work.
6
star
88

bevy-explorer

Rust
5
star
89

hammurabi

Repository to host the reference implementation made in Babylon.js by the Protocol Squad
TypeScript
5
star
90

schemas

Common schemas for Decentraland
TypeScript
5
star
91

decentraland-crypto-fetch

TypeScript
5
star
92

smart-contract-audits

Smart Contract Audit Reports
5
star
93

avatar-asset-test-tool

πŸ‘š Tools to help testing wearables for Decentraland
TypeScript
5
star
94

dcl-sprites

Helper functions to create sprites using Decentraland's SDK
TypeScript
5
star
95

decentraland-crypto-middleware

A multi framework middleware to authenticate request signed with @decentraland/SignedFetch
TypeScript
5
star
96

decentraland-transactions

Create transactions to be relayed
TypeScript
5
star
97

vr-client

5
star
98

tap-decentraland-thegraph

Exports data from Decentraland's subgraphs at https://thegraph.com/
Python
5
star
99

whitelist-sale

Contract for the Whitelist sale for Decentraland
JavaScript
4
star
100

voting

πŸ—³ERC-20 Based Off-chain Voting
JavaScript
4
star