Ok, lets setup UWB's development environment.
Prerequisites
These prerequisites are mandatory to compile UWB.
Unity 2021.3.x
.NET 8 SDK
PowerShell (formally PowerShell Core)*
Git
*Modern PowerShell is required! The one built into Windows does NOT work.
Additional Optional Prerequisites
These prerequisites are not required, but some areas may require them.
NodeJS
Yarn
Repo Setup
We first need to obtain UWB's code. UWB is all contained in one-mono repo, found at https://github.com/Voltstro-Studios/UnityWebBrowser.git
.
To get the UnityWebBrowser
repo, you first need to clone the repo recursively using Git, like so:
git clone --recursive https://github.com/Voltstro-Studios/UnityWebBrowser.git
Note
If you did NOT clone the repo recursively, you can just init the submodules by running these commands at the root of the repo:
git submodule init
git submodule update
Once you have the repo cloned with the submodules, you must now run the src/setup-all.ps1
script with PowerShell.
You can go into PowerShell with the command:
pwsh
Once in PowerShell, go to the src/
directory, and run the setup-all.ps1
script:
./setup-all.ps1
Depending on your system, and your download speeds, this script could take upto a minute or even longer. You only need to run the setup script once.
You can now open up the src/UnityWebBrowser.UnityProject
project with Unity.
Editor Tools
Once in Unity, you can open the provided UWB
scene provided in the project. By default, this scene is setup to have basic browser controls/window.
When running the project in this scene, a provided 'UWB Debug UI' will be available.
Note
By default this is "hidden", you can open the UI via the small panel at the top of the player's window.
The 'UWB Debug UI' provided has some useful stats and controls that you may want to use.
If you need to, extra controls can be added by modifying the Assets/Scripts/UWBPrjDebugUI.cs
script.
(In the future we hope to develop more editor tools to make life easier.)
Core/Unity Packages Dev Work
Open Unity's C# project with your preferred IDE. You should be able to edit UWB's packages from the same solution that Unity generates. Remember that UWB's packages are located in src/Packages/
.
Engine/Shared Project Dev Work
You can open src/UnityWebBrowser.sln
with your preferred IDE. The rest of the external projects are contained within this solution, including the shared project and engine projects.
Dev Scripts
There a many dev scripts in the src/DevScripts
directory. The main ones that you will most likely use are:
download-cef-<OS>.ps1
publish-<Section>-<OS>.ps1