using UnityEngine; namespace UnityAtoms.MonoHooks { /// /// Mono Hook for [`OnTriggerEnter`](https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnTriggerEnter.html), [`OnTriggerExit`](https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnTriggerExit.html) and [`OnTriggerStay`](https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnTriggerStay.html) /// [EditorIcon("atom-icon-delicate")] [AddComponentMenu("Unity Atoms/Hooks/On Trigger")] public sealed class OnTriggerStayHook : ColliderHook { /// /// Set to true if Event should be triggered on `OnTriggerEnter` /// [SerializeField] private bool _triggerOnEnter; /// /// Set to true if Event should be triggered on `OnTriggerExit` /// [SerializeField] private bool _triggerOnExit; /// /// Set to true if Event should be triggered on `OnTriggerStay` /// [SerializeField] private bool _triggerOnStay; private void OnTriggerEnter(Collider other) { if (_triggerOnEnter) OnHook(other); } private void OnTriggerExit(Collider other) { if (_triggerOnExit) OnHook(other); } private void OnTriggerStay(Collider other) { if (_triggerOnStay) OnHook(other); } } }