Search Issue Tracker
By Design
Votes
10
Found in
4.3.0b6
Issue ID
571898
Regression
No
Awake & Start not called before Update when assembly is reloaded for ExecuteInEditMode scripts
To reproduce:
1. Open the attached project
2. Observe that "Awake", "Start", "Update" is displayed in the console (because of the ExecuteInEditMode script)
3. Reimport the script to trigger recompile
4. Move the camera around
5. Notice that "Update" is called without any calls to "Awake" and "Start"
Note:
Awake and Start are not called on the object because they were already called on this object upon its first creation. On load, the object state is serialized (public and private variables) and then deserialized. When deserialization happens, as long as the object already existed, Awake nor Start are not invoked.
This is by design, and it's tightly coupled in the MonoBehaviour lifecycle. Changing this behavior will possibly impact on all the projects that don't expect Awake/Start to be invoked.
Comments (11)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Texture2D hash changes inside of an AssetBundle when rebuilding a SpriteAtlas bundle with an empty AssetPostprocessor Script enabled
- Aniso Level still applies when Generate MipMap is disabled in Texture Import Settings
- Mipmap Limit Groups long names are not truncated when creating a new Mipmap Limit Group with a long name
- “ArgumentException: Invalid double parameter.” error is thrown when Infinity is typed into the Fixed Timestep field
- GameObject becomes gray when using HDRP and STP together on macOS
markspolakovs
Aug 04, 2016 07:19
Why is this a wontfix? This is an issue that I'm running into. I might just be missing something, but it seems like something that should be fixed.