Welcome! This is the GuildFi Unity Proof of Concept. It demonstrates the following:
- Unity WebGL app running in a React app
- Communication between Unity and React
- On-demand loaded assets from CDN
- Simple toon shader
There are two main parts to this project: the Unity project and the React project. The Unity project is in the unity folder. The React project is in the workspace root.
The latest build of the Unity project is already in the public folder. Unless you are working on the Unity project, you do not need to build it. You can just run the React app.
From the workspace root:
yarn
If you plan on working on the Unity project, you will need to install Unity. The version used for this project is 2020.3.0f1.
There are two things that need to be built: addressable bundles and the unity build itself. The addressable bundles must also be deployed to the CDN for a full build.
If you are just debugging within the editor, you only need to build the addressable bundles. You can skip uploading addressable bundles to the CDN. The addressables bundles will be loaded from the local file system. You also don't need to do the Unity build to debug in the editor (obviously).
- Open unity/guildfi-unity-poc-alpha in Unity
- Windows->Asset Management->Addressables->Groups->Build
At this point, you can debug in the editor. Do the remaining steps to complete the build for use in the React app.
- Build the player with WebGL target to public/unity/guildfi-unity-poc-alpha
- Windows->Asset Management->Adressables->Groups->Build to CCD
From the workspace root:
yarn dev
From the workspace root:
yarn build
You can now serve the dist folder if you'd like.
firebase deploy
- Shaders as addressables in default bundle
- try performance on low end phone
- Compare against threejs / babylonjs
- Build multiple version of the Unity app for different texture compressions - DXT1 (desktop), ETC (mobile), ASTC (mobile)
- Progressively loaded models and/or texures? Is it needed?
- models in addressable bundles are much larger than expected