protected virtual void Transition(MonoState value) { if (currentState == value || inTransition) { return; } inTransition = true; if (currentState != null) { currentState.Exit(); } currentState = value; if (currentState != null) { currentState.Enter(); } inTransition = false; currentState.AfterTransition(); }
public virtual void ChangeState <T>() where T : MonoState { CurrentState = GetState <T>(); }
protected virtual void Start() { this.CurrentState = firstState; }