Exemplo n.º 1
0
 /// <summary>
 /// 狀態切換
 /// </summary>
 public void ChangeState(IAIState state)
 {
     currestState.Exit();
     previousState = currestState;
     currestState  = state;
     currestState.Enter();
 }
Exemplo n.º 2
0
    //Changes the current Ai state
    public void ChangeState(IAIState newState)
    {
        if (currentAIState != null)
        {
            //Runs the state exit code
            currentAIState.Exit();
        }

        currentAIState = newState;

        //Do enter state code and send our self as the Enemy
        currentAIState.Enter(this);
    }