When we assign method from script A (MonoBehaviour), to script's B event which inherits from UnityEvent by AddListener method, it (A method) receives callbacks. When we disable component A (script A) it still receives callbacks.
This behaviour is unwanted and it force us, to write everywhere the same pattern. Add listeners in OnEnable and remove them in OnDisable methods. I thought unity's events in comparision with .NET ones at least gives us this "syntactic sugar".
This behaviour is unwanted and it force us, to write everywhere the same pattern. Add listeners in OnEnable and remove them in OnDisable methods. I thought unity's events in comparision with .NET ones at least gives us this "syntactic sugar".