Exemplo n.º 1
0
 void OnDestroy()
 {
     if (deviceController != null && deviceController.GetDevice() != null)
     {
         CVirtDevice virtDevice = deviceController.GetDevice();
         if (virtDevice.HasHaptic())
         {
             virtDevice.HapticStop();
         }
     }
 }
Exemplo n.º 2
0
        public void OnCVirtDeviceControllerCallback(CVirtDevice virtDevice, CVirtDeviceController.CVirtDeviceControllerCallbackType callbackType)
        {
            switch (callbackType)
            {
            case CVirtDeviceController.CVirtDeviceControllerCallbackType.Connect:
                virtDevice.HapticSetGain(4);
                virtDevice.HapticSetFrequency(60);
                virtDevice.HapticSetVolume(0);
                //
                virtDevice.HapticPlay();
                break;

            case CVirtDeviceController.CVirtDeviceControllerCallbackType.Disconnect:
                virtDevice.HapticStop();
                break;
            }
        }