Most Unity scripts attached to GameObjects inherit from MonoBehaviour.
public class Player : MonoBehaviour
{
}
Important lifecycle methods:
void Awake() {}
void OnEnable() {}
void Start() {}
void Update() {}
void FixedUpdate() {}
void LateUpdate() {}
void OnDisable() {}
void OnDestroy() {}
Typical uses:
Awake: early initialization and referencesStart: initialization before the first frameUpdate: frame-based logic and inputFixedUpdate: physicsLateUpdate: follow-up logic such as cameras