public void TriggerHapticPulse(ushort durationMicroSec = 500, NVRButtons button = NVRButtons.Grip) { if (InputDevice != null) { if (durationMicroSec < 3000) { InputDevice.TriggerHapticPulse(durationMicroSec, button); } else { Debug.LogWarning("You're trying to pulse for over 3000 microseconds, you probably don't want to do that. If you do, use NVRHand.LongHapticPulse(float seconds)"); } } }
protected void UpdateHovering() { if (CurrentHandState == HandState.Idle) { var hoveringEnumerator = CurrentlyHoveringOver.GetEnumerator(); while (hoveringEnumerator.MoveNext()) { var hoveringOver = hoveringEnumerator.Current; if (hoveringOver.Value.Count > 0) { hoveringOver.Key.HoveringUpdate(this, Time.time - hoveringOver.Value.OrderBy(colliderTime => colliderTime.Value).First().Value); } } } if (InputDevice != null && IsInteracting == false && IsHovering == true) { if (Player.VibrateOnHover == true) { InputDevice.TriggerHapticPulse(100); } } }