Introduction to MonoBehaviour in Unity

Notes:

What is MonoBehaviour?
- MonoBehaviour is a base class from which every Unity script is derived
- That is every Unity script extends the MonoBehaviour class

Why?
- Unity calls and executes various event methods in a pre-determined order.

Ex:
Start(): just before the first Update call
Update(): every frame continuously
Awake(): when a script is instantiated
OnEnable(): whenever a script is enabled
OnCollisionEnter(): whenever two colliders hit each other
OnApplicationQuit(): when user quits the application
OnDisable():whenever a script is disabled
OnDestroy(): when an object is destroyed

- To use any of the event methods Awake(), Start(), Update() etc. inside our script;

we must extend our script from the MonoBehaviour class;
because they all are defined inside MonoBehaviour class