Exemplo n.º 1
0
 public override void TriggerHapticVibration(int index, float durationSeconds = 0.1f, float frequency = 1000f, float amplitude = 0.5f)
 {
     if (!Inited)
     {
         return;
     }
     if (states[index].controllerType == ControllerType.CONTROLLER_TYPE_PHONE)
     {
         PhoneVibrateTool.TriggerVibrate(durationSeconds);
     }
     else
     {
         if (m_NativeController != null && TXRInput.GetControllerAvailableFeature(ControllerAvailableFeature.CONTROLLER_AVAILABLE_FEATURE_HAPTIC_VIBRATE))
         {
             Int64 durationNano = (Int64)(durationSeconds * 1000000000);
             m_NativeController.TriggerHapticVibrate(index, durationNano, frequency, amplitude);
         }
     }
 }