示例#1
0
 public void CancelControllerVibrations()
 {
     Debug.Log("Vibration cancelled");
     VRTK_ControllerHaptics.CancelHapticPulse(VRTK_ControllerReference.GetControllerReference(LeftController));
     VRTK_ControllerHaptics.CancelHapticPulse(VRTK_ControllerReference.GetControllerReference(RightController));
     isVibrating = false;
 }
示例#2
0
 private void TurnOff()
 {
     if (m_controller != null)
     {
         VRTK_ControllerHaptics.CancelHapticPulse(m_controller);
     }
     m_waterParticleSystem.Stop();
     m_soundEmitter.Stop();
 }
示例#3
0
 private void Io_InteractableObjectUngrabbed(object sender, InteractableObjectEventArgs e)
 {
     CancelInvoke("DoHaptics");
     if (controllerReference != null)
     {
         Debug.Log(VRTK_DeviceFinder.GetControllerVelocity(controllerReference));
         VRTK_ControllerHaptics.CancelHapticPulse(controllerReference);
     }
     controllerReference = null;
 }
示例#4
0
 private void Deactivate()
 {
     m_suckedRigidbodies.Clear();
     m_suckedGarbages.Clear();
     if (m_controller != null)
     {
         VRTK_ControllerHaptics.CancelHapticPulse(m_controller);
     }
     m_windParticles.FastStop(true, 0, 1);
     m_soundEmitter.Stop();
 }
 /// <summary>
 /// The HapticsOnTouch method triggers the haptic feedback on the given controller for the settings associated with touch.
 /// </summary>
 /// <param name="controllerReference">The reference to the controller to activate the haptic feedback on.</param>
 public virtual void HapticsOnTouch(VRTK_ControllerReference controllerReference)
 {
     if (strengthOnTouch > 0 && durationOnTouch > 0f)
     {
         TriggerHapticPulse(controllerReference);
     }
     else
     {
         VRTK_ControllerHaptics.CancelHapticPulse(controllerReference);
     }
 }
示例#6
0
    private void OnTriggerExit(Collider collider)
    {
        if (saberCollisionVibrationLevel > 0)
        {
            if (collider.CompareTag("Saber"))
            {
#if UNITY_ANDROID
                var controller = controllerReference.actual.GetComponent <QuestHapticFeedback>();
                controller.CancelHapticPulse();
#else
                VRTK_ControllerHaptics.CancelHapticPulse(controllerReference);
#endif
            }
        }
    }
示例#7
0
    public void StopFeedback()
    {
        isEnabled = false;

        if (controller.HasFlag(VR_Controller.Left))
        {
            VRTK_ControllerHaptics.CancelHapticPulse(leftController);
        }

        if (controller.HasFlag(VR_Controller.Right))
        {
            VRTK_ControllerHaptics.CancelHapticPulse(rightController);
        }

        if (VRTK_ControllerReference.IsValid(grabbedController))
        {
            VRTK_ControllerHaptics.CancelHapticPulse(grabbedController);
        }
    }
 /**
  * InteractableObjectUntouched is a method that is activated when one of the controllers
  * leaves the interactable objects collider.
  * @params: sender- the sender is the game object that is getting interacted with(io)
  * @params: e- e is the object that is interacting with the io.
  **/
 private void Io_InteractableObjectUntouched(object sender, InteractableObjectEventArgs e)
 {
     Debug.Log("Untouched");
     VRTK_ControllerHaptics.CancelHapticPulse(controllerReference);
     controllerReference = null;
 }
 /// <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);
 }