static void Main(string[] args) { if (args.Length == 0) { Console.WriteLine("Do not execute this application!"); return; } EventRegistry.BuildDictionary(); SynchronizationContext.SetSynchronizationContext(new SynchronizationContext()); _eventServer = new EventServer(Int32.Parse(args[0])); _eventServer.OnEventReceived += EventReceivedHandler; _eventServer.Start(); CefSettings settings = new CefSettings(); CefSharpSettings.ShutdownOnExit = true; settings.CefCommandLineArgs.Remove("mute-audio"); Cef.Initialize(settings, performDependencyCheck: true, browserProcessHandler: null); while (true) { Thread.Sleep(1); } }
public void Initialize() { if (_instance != null && _instance != this) { Destroy(this.gameObject); return; } _instance = this; EventRegistry.BuildDictionary(); _eventClient = new EventClient(EventServerPort); _eventClient.OnEventReceived += EventReceivedHandler; _eventClient.Start(); _cefInstances = new Dictionary <string, CefInstance>(); }