internal void StartGame() { this.DoExitGame(); base.wantsMouseMove = true; this.bridge = new NScreenBridge(); this.bridge.InitServer(this.id); this.bridge.SetResolution((int)base.minSize.x, (int)base.minSize.y); this.remoteProcess = new Process(); this.remoteProcess.EnableRaisingEvents = true; this.remoteProcess.Exited += new EventHandler(this.HandleExited); this.remoteProcess.StartInfo.FileName = "Temp/NScreen/NScreen.app/Contents/MacOS/NScreen"; this.remoteProcess.StartInfo.Arguments = "-nscreenid " + this.id; this.remoteProcess.StartInfo.UseShellExecute = false; try { this.remoteProcess.Start(); } catch (Win32Exception) { this.remoteProcess = null; this.DoExitGame(); } this.bridge.StartWatchdogForPid(this.remoteProcess.Id); this.shouldExit = false; }
internal void DoExitGame() { if ((this.remoteProcess != null) && !this.remoteProcess.HasExited) { this.remoteProcess.Kill(); this.remoteProcess = null; base.Repaint(); } if (this.bridge != null) { this.bridge.Shutdown(); this.bridge = null; this.oldWidth = 0; this.oldHeight = 0; } base.wantsMouseMove = false; this.shouldExit = true; }
internal void DoExitGame() { if (this.remoteProcess != null && !this.remoteProcess.HasExited) { this.remoteProcess.Kill(); this.remoteProcess = (Process) null; this.Repaint(); } if ((UnityEngine.Object) this.bridge != (UnityEngine.Object) null) { this.bridge.Shutdown(); this.bridge = (NScreenBridge) null; this.oldWidth = 0; this.oldHeight = 0; } this.wantsMouseMove = false; this.shouldExit = true; }