Page 1 of 1

Possible design of the "Unity CEF Plugin"

PostPosted: Sun Aug 23, 2020 10:35 pm
by F32
Unity3D is a popular game engine. Though it has a flexible scripting (plugin) system based on c#, there's no builtin webview control.

I'm thinking about implementing a "Unity CEF Plugin" so that users can view web pages in the game.

Game develops configure game objects in different scenes, attach c# scripts to different game objects in an IDE called "Unity Editor". When everything is done, they cross-build the game for different platforms.

Since the build procedure is automatic, we have no control over the entry point (main function) in the binary. So it's difficult to embed CEF into Unity applications directly.

The only solution I can think about is to split "Unity CEF Plugin" into two parts:
- Part one is a standalone CEF executable that does off-screen rendering and sends screenshots by tcp
- Part two is a standard unity plugin (c# or c/c++ native) that receive browser screenshots from tcp and put into game scene

I believe that there are also other cases like this, where it's difficult to embed CEF into application's entry point. Is it the proper way to solve this problem?