Hi,
I built this small diagram showing what I’ve observed from Unity script execution order when going from EditMode to PlayMode:
EditorScripts is a script ihneriting from Editor and ExecuteAlways is a script that runs in edit mode and play mode. Global are static calls made with special Unity Attributes.
What I know is that Unity needs to Serialize the data before doing in play mode, so that it can revert back any changes made while in play mode. From that, steps 1,2,3 make sense, but I’m not sure to understand why steps 4,5,6,7 exist. For me, this looks like if there was a serialized state between EditMode and PlayMode. For ExecuteAlways, if our script runtime instances are created after step 8, why on earth are they Enabled/Disabled/Destroyed (5-7) ?
The problem with this is that when I do a lot of stuff in OnEnable, like subscribing to events from a global service, I will do this twice each time I go in play mode, because we will do this at step 5 and step 10.
Thank you!

