Ethereal-Software / virtual-world

Virtual world interaction
0 stars 0 forks source link

Unity in-game browser #27

Open RoddoWasHere opened 4 years ago

RoddoWasHere commented 4 years ago

https://github.com/bkeiren/AwesomiumUnity (req. Unity Pro) https://github.com/gree/unity-webview https://github.com/ultralight-ux/Ultralight/releases

?? https://github.com/aleab/cef-unity-sample CefGlue: https://github.com/vibeeshan025/Chrome.Net

CefSharp resources:

https://csharp.hotexamples.com/examples/-/CefSettings/-/php-cefsettings-class-examples.html

events: https://xilium.bitbucket.io/cefglue/doc/html/FE105FC1.htm

browser.GetBrowser().GetHost().SendMouseMoveEvent(300, 25, false, CefEventFlags.LeftMouseButton);
browser.GetBrowser().GetHost().SendMouseClickEvent(300, 25, MouseButtonType.Left, false, 1, CefEventFlags.LeftMouseButton);
browser.GetBrowser().GetHost().SendMouseClickEvent(300, 25, MouseButtonType.Left, true, 1, CefEventFlags.LeftMouseButton);

Maybe interleave with:

System.Threading.Thread.Sleep(100);

Google auth for embedded CEF: https://developers.google.com/identity/protocols/oauth2/native-app https://authguidance.com/2018/01/11/desktop-apps-overview/

More on browsers:

https://unitylist.com/p/x1k/Unity-cef-gui https://github.com/pampas93/SimpleUnityBrowser

Performance tests:

version: 3.3239.1723.g071d1c1 (+/- 2018) Youtube video: CPU: 30% (@ 2.9 GHz, 4 processors) Idle: CPU: +/-15% (@ 2.9 GHz, 4 processors) RAM: 280 Mb

version: ?? older CPU: 48% (@ 2.9 GHz, 4 processors) Idle: CPU: 20% (@ 2.9 GHz, 4 processors) RAM: 280 Mb

*Its worth noting that the APIs are different

Structuring data

So a Screen: Network behaviour has a host (network id or whatever) ...and

A browser belongs to the player: Mono behaviour

So..

  1. load (default) page (no update/syncing) on startup
  2. screen interact = take control and sync
  3. relieve control (how?) -> load default page, then screen is (available)

So it might be worth noting that the interaction with the browser and browser itself are separate

so...

BrowserInteracter

Browser

*Tips:

Data structures: