6using System.Collections;
7using System.Collections.Generic;
16 private bool playOnBothControllers;
18 private bool playLeftFirst;
20 private bool stopHapticsExitTriggerCollision;
22 private GameObject controllerLeft;
24 private GameObject controllerRight;
26 private GameObject controller => playLeftFirst ? controllerLeft : controllerRight;
35 DebugMode(
string.Format(
"Started playing haptics! + {0}", Time.time));
45 ActivateHaptics(other.gameObject);
51 ActivateHaptics(other.gameObject);
54 private void ActivateHaptics(GameObject other)
56 if ((playOnBothControllers) || (other == controller))
72 if (stopHapticsExitTriggerCollision)
80 if (stopHapticsExitTriggerCollision)
virtual void Play()
Call this method to play the haptic effect.
void DebugMode(string debugMessage)
Debug method to print messages in the console only when debugMode is enabled.
double hapticEffectDuration
override void OnCollisionExit(Collision other)
override void Start()
Initialize the haptic effect settings at the start of the game.
override void OnTriggerEnter(Collider other)
override void OnTriggerExit(Collider other)
override void OnCollisionEnter(Collision other)
IEnumerator XRControlVibration(GameObject hbp)
void RemoveTarget(GameObject target)
void AddTarget(GameObject target)