/// <summary>
 /// The HapticsOnUse method triggers the haptic feedback on the given controller for the settings associated with use.
 /// </summary>
 /// <param name="controllerReference">The reference to the controller to activate the haptic feedback on.</param>
 public virtual void HapticsOnUse(VRTK_ControllerReference controllerReference)
 {
     if (clipOnUse != null)
     {
         VRTK_ControllerHaptics.TriggerHapticPulse(controllerReference, clipOnUse);
     }
     else if (strengthOnUse > 0 && durationOnUse > 0f)
     {
         TriggerHapticPulse(controllerReference, strengthOnUse, durationOnUse, intervalOnUse);
     }
     else
     {
         VRTK_ControllerHaptics.CancelHapticPulse(controllerReference);
     }
     OnInteractHapticsUsed(SetEventPayload(controllerReference));
 }
示例#2
0
 public static void CancelHapticPulse(uint controllerIndex)
 {
     VRTK_ControllerHaptics.CancelHapticPulse(VRTK_ControllerReference.GetControllerReference(controllerIndex));
 }
 /// <summary>
 /// The CancelHaptics method cancels any existing haptic feedback on the given controller.
 /// </summary>
 /// <param name="controllerReference"></param>
 public virtual void CancelHaptics(VRTK_ControllerReference controllerReference)
 {
     VRTK_ControllerHaptics.CancelHapticPulse(controllerReference);
 }