Ejemplo n.º 1
0
    protected void TransitionToState(IActorState nextState)
    {
        Log(string.Format(Time.frameCount + " {0} Going from {1} to {2}", this, CurrentState.Name, nextState.Name), this);

        CurrentState.OnExit();
        OnStateChangeEvent(CurrentState, nextState);
        nextState.OnEnter();
        CurrentState = nextState;
        StateName    = CurrentState.Name;
    }
Ejemplo n.º 2
0
 protected virtual void Start()
 {
     CurrentState = CreateInitialState();
     CurrentState.OnEnter();
     StateName = CurrentState.Name;
 }