//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.");
     }
 }
Ejemplo n.º 2
0
 ///<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();
             }
         }
     }
 }
Ejemplo n.º 3
0
    //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);
            }
        }
    }