using UnityEngine; using UnityEngine.Events; namespace UnityAtoms { public class MonoHook : MonoBehaviour where E1 : GameEvent where E2 : GameEvent where SF : GameFunction { public E1 Event; public E2 EventWithGORef; [SerializeField] protected SF SelectGORef; protected void OnHook(EV value) { if (Event != null) { Event.Raise(value); } if (EventWithGORef != null) { EventWithGORef.Raise(value, SelectGORef != null ? SelectGORef.Call(gameObject) : gameObject); } } } }