MonoBehaviour class
is a base class from which every Unity script is derived.
Note: Every Unity script extends the MonoBehaviour class.
Why Unity scripts extend from MonoBehaviour class?
Because: Unity calls and executes various event methods in a pre-determined order.
Example:
Start()
called just before the first Update call.
Update():
called every frame continuously.
Awake():
called when a script is instantiated.
OnEnable():
called whenever a script is enabled.
OnCollisionEnter():
called whenever two colliders hit each other.
OnApplicationQuit():
called when user quits the application.
OnDisable():
called whenever a script is disabled.
OnDestroy():
called when an object is destroyed.
In questa pagina del sito puoi guardare il video online Introduction to MonoBehaviour Class - Unity Scripting API Tutorial 01 della durata di ore minuti seconda in buona qualità , che l'utente ha caricato GameLabBD 31 ottobre 2024, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 35 volte e gli è piaciuto 3 spettatori. Buona visione!