OnEnable not called after all Awake and not all OnDisable before OnDestroy?

The main reason I ask this is, that OnEnable and OnDisable seem to be perfect to toggle things on and off, right? Like Event-Subscriptions. Subscribe in OnEnable and Unsubscribe in OnDisable, nice. In my case, that leads to a problem, because I execute code in the add section of one of those property events. Unfortunately, the Object it’s operating on is not yet referenced, because Awake on the other Object has not been called. at that time. I recognised, that I get an alternating chain of Awake and OnEnable if I debug.Log those calls.

Since the Constructor is ran by Unity, why is there not one method that runs on all GameObjects first. This way everything else would be bulletproof.

Same goes for OnDisable. I CAN’T Unsubscribe from events here, because the object I was subscribed to might not exist anymore. OnDisable and OnDestroy are also alternating their calls… How am I supposed to use toggling a script on and off with that?

Have you checked out this Execution of Events article? Might shed some light on the actual order functions are called in the Unity lifetime. I’ve never seen or heard of the functions being called out of order, so you might need to rearrange some of your function calls. It’s usually recommended that variables are initialised in Awake() and references set in Start(), but of course this differs for different projects and different scenarios. You might need to delay grabbing references until the thing you require is initialised. Even have the initialise function send off an event once it’s up and running and THEN toggle things when receiving that event? I’m afraid I’m short of other suggestions without actually looking at your project because it sounds pretty specific!