//Cleanup if the game gets terminated. This is important to //prevend connection failures. void OnDisable() { if (virtDevice != null) { virtDevice.Close(); CLogger.Log("Automatically disconnected from Virtualizer device."); } }
///<summary> /// Handle quitting of game, critical errors (Unity crashing) will be thrown if this is not kept/defined /// </summary> /// <return>void</return> public void OnDestroy() { if (m_DeviceController != null) { CVirtDevice device = m_DeviceController.GetDevice(); if (device != null) { if (device.IsOpen() == true) { device.Close(); } } } }
//Cleanup if the game gets terminated. This is important to //prevend connection failures. void OnDisable() { if (virtDevice != null) { virtDevice.Close(); CLogger.Log("Automatically disconnected from Virtualizer device."); // Callback if (this.OnCVirtDeviceControllerCallback != null) { this.OnCVirtDeviceControllerCallback(virtDevice, CVirtDeviceControllerCallbackType.Disconnect); } } }