Example #1
0
        public void AddAgent(Transform agentTrans)
        {
            NavmeshAgentController agent = agentTrans.GetComponent <NavmeshAgentController>();

            if (agent)
            {
                agents.Add(agent);
            }
        }
Example #2
0
        public void RemoveAgent(Transform agentTrans)
        {
            NavmeshAgentController agent = agentTrans.GetComponent <NavmeshAgentController>();

            if (agent)
            {
                agent.SetAgentActive(true);
                agent.transform.SetParent(null);
                agents.Remove(agent);
            }
        }