The diff between Awake,Start And OnEnable

The order of Awake/Start/OnEnable is :
1.Awake first.  This function was called when all game object are loaded.   note that : this function is called only once since the scene is started.
2.OnEnable Secondly. OnEnable is called when a game object or script is active or enable. This function can be called serval times between the scene running.
3.Start finally.This function was called after the two function above. This function can only be called once whatever the game object or script was enable or active.

你可能感兴趣的:(unity3d)