示例#1
0
 private void CheckStates()
 {
     if (AIStates[AIIndex] == "UnwareState")
     {
         m_currentAIState = m_unwareAIState;
     }
     else if (AIStates[AIIndex] == "PatrolState")
     {
         m_currentAIState = m_patrolAIState;
     }
     else if (AIStates[AIIndex] == "SearchState")
     {
         m_currentAIState = m_searchAIState;
     }
     else if (AIStates[AIIndex] == "ChaseState")
     {
         m_currentAIState = m_chaseAIState;
     }
     else if (AIStates[AIIndex] == "CoverState")
     {
         m_currentAIState = m_coverAIState;
     }
     else if (AIStates[AIIndex] == "CorrespondingActionState")
     {
         m_currentAIState = m_gunFireAIState;
     }
 }
示例#2
0
 public virtual void dispose()
 {
     unRegisterEvt();
     this._npcAIComponent = null;
     this._aiContext      = null;
     this._aiStateManager = null;
     this._host           = null;
 }
示例#3
0
 public BaseNPCAIState(IAIComponent npcAIComponent)
 {
     this._npcAIComponent = npcAIComponent;
     this._aiContext      = npcAIComponent as IAIContext;
     this._aiStateManager = npcAIComponent as IAIStateManager;
     this._host           = npcAIComponent.host();
     init();
 }
 public BaseMonsterAIState(IAIComponent monsterAIComponent)
 {
     this._monsterAIComponent = monsterAIComponent;
     this._aiContext          = monsterAIComponent as IAIContext;
     this._aiStateManager     = monsterAIComponent as IAIStateManager;
     this._host = monsterAIComponent.host();
     init();
 }
示例#5
0
        public void ChangeAIState(IAIStateManager state)
        {
            if (m_currentAIState != null)
            {
                m_currentAIState.OnStateExit();
            }

            m_currentAIState = state;
            m_currentAIState.OnStateEnter();
        }