public void UpdateState(PlayerInputs input) { if (changedState) { CurrentState.OnExitState(); PreviousState = CurrentState; CurrentState = NextState; MovementModel.State = CurrentState.State; CurrentState.OnEnterState(); changedState = false; } CurrentState.OnUpdateState(input); }