AStateMachine.TransitionTo C# (CSharp) Метод

TransitionTo() публичный Метод

Transitions the current state to its next state. Will not transition if the current state do not have any next state!
public TransitionTo ( string stateLabel ) : void
stateLabel string
Результат void
    public void TransitionTo(string stateLabel)
    {
        if(this.currentState.HasTransition(stateLabel)) {
            this.currentState.OnExit();
            this.currentState = this.currentState.GetTransitionState(stateLabel);
            this.currentState.OnEnter();
        }
        else {
            Debug.LogError("Transition state " +stateLabel+ " does not exist in " +this.currentState.GetLabel());
        }
    }