using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Events; namespace InfallibleCode { public class EventTriggerRaycast : MonoBehaviour, IInteractable { public UnityEvent Action; public bool doEventOnce; private bool canInvokeEvent = true; public void Invoke() { if (canInvokeEvent) { Action.Invoke(); if (doEventOnce) { canInvokeEvent = false; //gameObject.SetActive(false); } } } public void Interact() { Invoke(); } } }