Is it possible to make custom automatically-called methods like Start and Update?
I thought it might be possible to use the IEventSystemHandler interface as a base interface for what I needed, and then execute it using the ExecuteEvents.Execute method to execute the method on all classes that implement that interface. The problem is that this method (ExecuteEvents.Execute) asks for an object it should be called on, this is a problem since I need to call it on all of the implementations at the same time.
Later I found it this system is not supposed to be used like that, but only in UI events, so I kinda give up on that.
So I want to make it be automatically called, in a way I can call it whenever it's needed and it will be called on all the implementations of that interface.
I also cannot make an abstract class, because the implementations of the interface sometimes have a different subclass. Interfaces is just the best way to do it in that case.
And just so you know, the reason I don't use events and delegates is because if I do I take the risk of forgetting to assign/un-assign the method from the event, which is kinda annoying.
Your answer
Follow this Question
Related Questions
UnityEvent Generic (Inspector Serialization) 0 Answers
Convert Event.current.mousePosition to Input.mousePosition 0 Answers
Unity Events not registering a function due to custom parameters 0 Answers
Count and find NON-PERSISTENT UnityEvent listeners: How? 1 Answer
Way to assign event fields in created at runtime scriptable object (ScriptableObject Architecture) 0 Answers