Пример #1
0
 /// <summary>
 /// Trigger vibration of a certain handedness controller
 /// </summary>
 public static void TriggerHapticVibration(float durationSeconds = 0.1f, float frequency = 200f, float amplitude = 0.8f)
 {
     if (!HapticVibrationEnabled)
     {
         return;
     }
     PhoneVibrateTool.TriggerVibrate(durationSeconds);
 }
Пример #2
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);
         }
     }
 }