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
- Memory usage rises when switching scenes with GRD enabled and a loaded texture in URP
- [Quality Hackweek] Terrain Brush Size value is not serialized after deselecting the terrain when using the first instance of multiple Inspectors
- "NullReferenceException" is thrown when setting a long string in TMP with "Atlas Population Mode" set to "Dynamic" and "Multi Atlas Textures" enabled
- TextMeshPro text is misaligned when alignment is set via script
- A DX11 shader error is thrown when compiling shaders for platforms without DX11 support
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.