using GameplayIngredients.Managers; using NaughtyAttributes; namespace GameplayIngredients.Events { public class OnUpdateEvent : EventBase { [ReorderableList, EnableIf("AllowUpdateCalls")] public Callable[] OnUpdate; private void OnEnable() { if(AllowUpdateCalls()) Manager.Get().Register(SingleUpdate); } private void OnDisable() { if (AllowUpdateCalls()) Manager.Get().Remove(SingleUpdate); } private void SingleUpdate() { Callable.Call(OnUpdate, gameObject); } } }