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

Scripting

-

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)

  1. 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.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.