Unity MonoBehaviour offers different magic events that you can attach to any GameObject. In this unity tutorial I will explain awake or start events as they both mostly use for assignment purposes.
Awake: Awake is invoked when the
MonoBehaviour is created. You may view it as your default constructor
Start: Start event executes after all initialization is done and the
first frame for the behavior is about to run. Start runs right before the
Update event.
Similarity:
Differences:
Awake
|
Start
|
Awake can't be used as coroutine.
|
Start can be used as coroutine
|
Awake is called
when the script object is initialised, regardless of whether or not the
script is enabled
|
Start is called on the frame when a script is enabled just before
any of the Update methods are called the first time
|
Start is called on the frame when a script is enabled just before any of the Update methods are called the first time.
|
0 Comments