public void ChangeState(PlayerBaseState newState) { if (currentState != null) { currentState.Exit(); } newState.Enter(); currentState = newState; }
public void TransitionToState(PlayerBaseState state) { if (currentState != null) { currentState.Exit(this); } currentState = state; currentState.Enter(this); }
public void ChangeState(PlayerBaseState newState) { currentState.Exit(); currentState = newState; newState.Enter(); }