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 UIbrowser-interface
to connect to the different aspects requiring of a web browser, such as connection with a wallet and WebRTC communicationsInstall 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
Check: Multiplatform in Editor
InitialScene
DebugConfig
GameObject.DebugConfig
inspector, make sure that Base url mode
is set to Custom
and Base url custom
is set to https://play.decentraland.zone/?
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
.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.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
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>
In order to run browser interface in any platform follow the next instructions
make watch
Visual Studio Code
devcontainers
extension installedAt Visual Studio Code
press F1
execute Reopen in Container
and wait for it to finish.Terminal > New Terminal
menu and run make watch
command. make watch
localhost:8080/test
in your browserUse 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.
make watch
command on browser-interface
path.DebugConfig
component inspector of InitialScene
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.
npm install
, make build-unity-local
and make watch
commands in that directory and leave that server running./build
folder (unity.loader.js
may not be necessary) and paste them inside browser-interface/node_modules/@dcl/explorer
.http://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.make watch
process.Alternatively you can go through these steps after step 3 and load the build locally using localhost:3000
npm run start:linked
in the cloned repo directory (npm i
first just in case)./build
folder (unity.loader.js
is not necessary as we use a modified loader) and paste them inside explorer-website/node_modules/@dcl/explorer
.localhost:3000
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
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.
This repository is protected with a standard Apache 2 license. See the terms and conditions in the LICENSE file.