示例#1
0
        public void Destroy()
        {
            Stop();

            m_Tree   = null;
            m_Runner = null;
            m_Agent  = null;
        }
示例#2
0
        public BTAgent(string btPath, string libraryName, string treeName)
        {
            m_BtPath      = btPath;
            m_LibraryName = libraryName;
            m_TreeName    = treeName;

            m_Pause  = false;
            m_Runner = null;
            m_Agent  = null;

            m_Actions = new List <BTAction>();
            m_Tree    = Reflecter.Instance.Instantiate(libraryName, treeName);
        }
示例#3
0
        public void SetAgent(IAgent agent)
        {
            if (m_Agent == null || m_Agent.Equals(null) || !m_Agent.Equals(agent))
            {
                m_Agent = agent;

                for (int i = 0; i < m_Actions.Count; i++)
                {
                    m_Actions[i].SetAgent(m_Agent);
                }

                if (m_Runner == null)
                {
                    m_Runner = new BTCoroutine(BTLauncher.Instance, Runner());
                }
            }
        }