Each state is a MonoBehaviour script that is enabled or disabled according to the transitions it comes from. We take advantage of the LateUpdate function in order not to change the usual train of thought when developing behaviors, and we use it to check if it is time to transition to a different state. It is important to disable every state in the game object, apart from the initial one.
The following diagram shows the graphical representation for a finite-state machine.