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
- Editor memory leak when entering and exiting Play Mode in a blank URP project
- Point Lights with the "Hard Shadows" Shadow Type appear as black squares when Rendering Path is set to "Forward+" or "Deferred+"
- Error SGICE002 is wrongly shown when the tuple elements in a foreach statement don’t match the order of the tuple returned by SystemAPI.Query
- LockBufferForWrite incorrectly rejects valid writes when GraphicsBuffer size exceeds 32-bit limit due to integer overflow
- Procedural rendering is disabled when using Graphics.RenderPrimitivesIndexedIndirect()
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.