public void Update()
 {
     // monitor flags for animation and state updates.
     currentState.OnUpdate(animator, ref flags);
 }