Skip to content

Getting started

Riekelt Brands edited this page Apr 1, 2021 · 7 revisions

Welcome to UnityCefSharp! In this article we'll walk through setting up your scene and adding our first Cef instance to render our UI.

Setting up your project

Note: if you already have the Newtonsoft.Json namespace available in your project use PostBuildClient.bat.dist, if you do not have this namespace in your project yet use PostBuildClient.bat.distWithJson

Tweak PostBuildClient.bat and PostBuildServer.bat and set your target directories appropriately. If you do not have these .bat files, copy them from their respective .bat.dist files.

Open the Visual Studio solution, and way for all the NuGet packages to finish loading.

Click Build Solution and wait for that to finish, the .bat files we just changed will also bootstrap your project with the .dlls and .exes we need.

Finally, copy over the scripts from UnityScripts to a good location in your project, where doesn't really matter.

That's it!

Setting up your scene

Add the ChromiumManager script to a game object in your scene. That's it, set a custom port for the event server if you need to.

Adding our Chromium GUI

Add the ChromiumGUI script to a game object in your scene, and tweak the options as you see fit. That's it, it should work out of the box given that the CefServer directory is located in the same directory as the Assets folder, not in the Assets folder!

Clone this wiki locally