Unity Web Browser (UWB) is a Unity package that allows displaying and interacting with the web from within a Unity project/game.
This project is capable of using any desired web engine you want, however for now we only have an engine using CEF.
Currently, 2.x is in development, but is the recommended version to use right now.
- Displays the web in your project via using a web browser engine.
- Full keyboard and mouse input
- API to interface with the web browser engine.
- Install as an Unity package
- Doesn't crash the entire editor on reload
- 100% free and open-source
- Multi-Platform Support
Getting a web engine to work in Unity is a pain, it usually ends up just crashing Unity. UWB resolves that issue via running the browser engine in separate process and "IPCing" data between the Unity game process and the engine process.
NOTE: The current version hosted on GitLab is 2.0.0-preview.3.
Unity 2021.2.x
- Open up the package manager via Windows -> Package Manager
- Click on the little + sign -> Add package from git URL...
- Type
https://gitlab.com/Voltstro-Studios/WebBrowser/Package.git#2.x
and add it - Type
https://gitlab.com/Voltstro-Studios/WebBrowser/Package.git#engine/cef/base
and add it - Type
https://gitlab.com/Voltstro-Studios/WebBrowser/Package.git#engine/cef/win-x64
and add it (If you need Windows support) - Type
https://gitlab.com/Voltstro-Studios/WebBrowser/Package.git#engine/cef/linux-x64
and add it (If you need Linux support) - Unity will now download and install the package
Please READ ALL OF THIS if you want to contribute or work on the project.
Unity 2021.3.x
.NET 6 SDK
PowerShell (formally PowerShell Core)
Git
-
Clone the repo with
git clone --recursive https://github.com/Voltstro-Studios/UnityWebBrowser.git
(Clone with sub-modules!) -
Run the
src/setup-all.ps1
script with PowerShell. Depending on your system, and your download speeds, this script could take upto a minute or longer. You only need to run this once. -
You can now open up the
src/UnityWebBrowser.UnityProject
project with Unity. -
To build the Unity project as a player, open Unity Volt Builder by going to Tools -> Unity Volt Builder -> Volt Builder and clicking on 'Build Player'.
The UWB core library supports all major desktop platforms (no mobile or console). However, each engine does require its own native package. Their platforms are listed below.
OS | Supported | Notes |
---|---|---|
Windows (x64) | ✔ | Works natively |
GNU/Linux (x64) | ✔ (Tested on Ubuntu 22.04) | Works natively |
MacOS (Intel) | ✖ | Planned |
MacOS (M1) | ✖ | No physical hardware to test or develop on |
- Voltstro - Initial work - Voltstro
This project is licensed under the MIT License - see the LICENSE.md file for details.
- CEF - Underlying web engine.
- CefGlue - C# wrapper.
- CefUnitySample - CEF directly in Unity. Has crashing problems tho.
- unity_browser - (Orginally by Vitaly Chashin) CEF working in Unity using IPC, but the project is in a messy state.
- ChromiumGtk - Linux stuff with CEF