public void Play() { if (this.playing == true) { this.Stop(); } this.playing = true; // timeStart = Time.time; hapticListener = CVirtHapticListener.getInstance(); if (hapticListener != null) { hapticListener.AddEmitter(this); } }
// Use this to set singletion instance void Awake() { if (singleInstance != null) { Debug.LogError("There are more than one CVirtHapticListeners in the scene. Please ensure there is always exactly one CVirtHapticListener in the scene."); } singleInstance = this; //Check if this object has a CVirtDeviceController attached deviceController = GetComponent <CVirtDeviceController>(); if (deviceController == null) { Debug.LogError("CVirtHapticListener gameobject does not have a CVirtDeviceController attached."); } if (deviceController != null) { deviceController.OnCVirtDeviceControllerCallback += this.OnCVirtDeviceControllerCallback; } }