We usually see a lot of things going on in Unity's animation state machine graph when we work alongside artists focused on animations, or when we use our own if we have a thing for this discipline; however, it's uncommon seeing things happening in code on top of it. We usually change states via the MonoBehaviour script, and deal with the behaviors in a separate manner.
In this recipe, we will use some of the basic movement behaviors created in Chapter 1, Behaviors – Intelligent Movement, as they are, and we will make our animator control their status.