示例#1
0
    public CAIController(CNPCEntity pNPC)
    {
        m_pOwner        = pNPC;
        m_pProto        = m_pOwner.m_pProto;
        m_pTarget       = null;
        m_eCurAIState   = AIStateType.AIST_Idle;
        m_pCurrentState = CIdleAI.Instance();
        m_pTransition   = new GuardTransition();

        m_GameObject = m_pOwner.gameObject;
        m_vBornPos   = m_GameObject.transform.position;
    }
示例#2
0
    public void ChangeState(AIStateType eState)
    {
        if (m_pCurrentState != null)
        {
            m_pCurrentState.Exit(this);
        }

        m_eCurAIState   = eState;
        m_pCurrentState = GetStateByType(m_eCurAIState);

        if (m_pCurrentState != null)
        {
            m_pCurrentState.Enter(this);
        }
    }