Just began to learn u3d, combined with web stickers to write their own a little superficial understanding:
A script for a game component has a lifecycle--an initial instantiation until the end instance is destroyed. During this time, they are sometimes active, sometimes inactive, and sometimes visible to the user and sometimes invisible to the activity.
Now let's look at each method's
Onawake method: Awake is invoked when a script instance is loaded
OnStart method: Start is invoked only before the update function is invoked for the first time.
Onuupdate method: Called before rendering a frame. This is where most of the game code is executed, in addition to physical code
Ongui method: Call when rendering and handling GUI events Here's not all frames are called OH
Fixedupdate method: This function is invoked once per physical time step. This is where the physical game behavior is based.
Lateupdat method: Is invoked after all update function calls. This can be used to adjust the order in which scripts are executed. For example: When an object moves in update, the camera following the object can be implemented in Lateupdate
Reset method: Reset to default value
Ondisable method: This function is invoked when an object becomes unavailable or inactive.
OnDestroy method: When Monobehaviour will be destroyed, this function is called
A new understanding of the follow-up will be added in succession.