Using Unity's Update and Start methods
Every time you create a script in Unity, these two skeleton methods are included. That's because they are rather important. These are the most commonly used MonoBehaviour
methods, see the next screenshot for others. I like to call these Unity's magic methods because you don't call these methods, Unity does. It's usually important that at least one MonoBehaviour
method is included in a Unity script to cause the script to execute. I say usually because other methods in the script may be called from another script or class.
How do I know these two methods are called by Unity and that they are MonoBehaviour
methods? Here, the Unity Scripting Reference is your friend.
Here's just a portion of the methods Unity can call in a script. This is from the Scripting Reference. Just search for MonoBehavior
:

Look at line 4 of LearningScript:
public class LearningScript : MonoBehaviour
This line says that LearningScript
inherits from MonoBehaviour
. Any script that inherits...