using ChivaXR.VR; using System.Collections; using System.Collections.Generic; using UnityEngine; namespace ChivaXR.VR { [RequireComponent(typeof(CVR_InteractableVRTK))] public class CVR_TriggerObj : MonoBehaviour { public bool isActive = false; private IVR_Interactable interactable; public delegate void TriggerSuccessed(); public TriggerSuccessed triggerSuccessed; private void Awake() { interactable = this.GetComponent(); interactable.CVR_InteractableObjectUsed += Interactable_CVR_InteractableObjectUsed; } private void Interactable_CVR_InteractableObjectUsed(object sender, CVR_InteractableObjectEventArgs e) { if (isActive) { triggerSuccessed?.Invoke(); } } } }