Adds a functional web browser to Unity without any issues or hassle.
This web browser uses CEF and CEFGlue to render the page to a texture and display it in Unity. This project also doesn't crash when you play in the editor for a second time.
- Displays the web using a modern web browser engine (Chromium)
- Load web pages from URL or HTML
- Controls and inputs
- Execute JS code
- Install as an Unity package
- Doesn't crash the entire editor
- Free and open-source
If you ever tried to use CEF in Unity, you know it doesn't go well, it always crashes due to how CEF works, and how Unity handles native plugins.
This project avoids these issues by running CEF in a separate process and using IPC to communicate data between Unity and the process.
Unity 2020.2.x
To install it via the package manager you will need to:
- 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
and add it - Unity will now download and install the package
Please READ ALL OF THIS if you want to contribute or work on the project.
Unity 2020.2.x
.NET 5 SDK
Powershell Core
-
Clone the repo with
git clone --recursive https://github.com/Voltstro-Studios/UnityWebBrowser.git
(Clone with sub-modules!) -
Run
scripts/download-cef-binaries.ps1
with PowerShell. -
Run
scripts/publish-browserprocess-and-copy-win64.ps1
with PowerShell. -
Add
src/CefBrowser/
as a package in Unity.
Right now we only support Windows, however a Linux version is on the TO-DO. MacOS may be supported in the future, but right now, it is too much work to support due to the lack of real-life hardware and having to use a virtual machine to test stuff for MacOS.
Other OSes such as Android and IOS cannot be supported due to the lack of knowledge on how to develop for this OSes.
- Voltstro - Initial work - Voltstro
This project is licensed under the LGPL-3.0 License - see the LICENSE file for details.