using UnityEngine; using UnityAtoms.BaseAtoms; namespace UnityAtoms.MonoHooks { /// /// Base class for all `MonoHook`s of type `Collider`. /// [EditorIcon("atom-icon-delicate")] public abstract class ColliderHook : MonoHook< ColliderEvent, Collider, GameObjectGameObjectFunction> { /// /// Event including a GameObject reference. /// public ColliderGameObjectEvent EventWithGameObjectReference { get => _eventWithGameObjectReference; set => _eventWithGameObjectReference = value; } [SerializeField] private ColliderGameObjectEvent _eventWithGameObjectReference; protected override void RaiseWithGameObject(Collider value, GameObject gameObject) { if (EventWithGameObjectReference) { EventWithGameObjectReference.Raise(new ColliderGameObject() { Collider = value, GameObject = gameObject }); } } } }