コード例 #1
0
    public void ChangeState(IAgentState newState)
    {
        if (currentState != null && currentState != newState)
        {
            currentState.Exit();
        }

        currentState = newState;
        currentState.Enter();
    }
コード例 #2
0
ファイル: Agent.cs プロジェクト: GikeyMe/2D-Platformer
 protected void SetState(IAgentState State)
 {
     activeState = State;
     activeState.Activate(this);                  // pass the agent that is changing states to the necessary state
 }
コード例 #3
0
 public void changeState(IAgentState aState)
 {
     _currentState = aState;
 }
コード例 #4
0
 public AgentV2(IAgentState currentState)
 {
     _currentState = currentState;
     _HP           = MAX_HP;
 }
コード例 #5
0
 protected void SetState(IAgentState State)
 {
     activeState = State;
     activeState.Activate(this);                  // pass the agent that is changing states to the necessary state
 }