public void ChangeState(IEntityState newState) { if (currentState != null && currentState.WillStop()) { currentState.Stop(); } currentState = newState; currentState.Enter(); }
public virtual void ChangeState(IEntityState <EntityState> newState) { CurrentState.Exit(); CurrentState = newState; CurrentState.Enter(); }