コード例 #1
0
 /// <summary>
 /// 狀態切換
 /// </summary>
 public void ChangeState(IAIState state)
 {
     currestState.Exit();
     previousState = currestState;
     currestState  = state;
     currestState.Enter();
 }
コード例 #2
0
ファイル: Enemy.cs プロジェクト: farzadmf/COMP-376-Team_Delta
    //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);
    }