示例#1
0
        public void RemoveAgent(Transform agentTrans)
        {
            NavmeshAgentController agent = agentTrans.GetComponent <NavmeshAgentController>();

            if (agent)
            {
                agent.SetAgentActive(true);
                agent.transform.SetParent(null);
                agents.Remove(agent);
            }
        }
示例#2
0
 public void SetSleeping(bool shouldSleep)
 {
     if (sleeping != shouldSleep)
     {
         Agent.SetAgentActive(!shouldSleep);
         AnimController.SetSleepVisuals(shouldSleep);
         SelectionHandler.IsSelectable = !shouldSleep;
         sleeping = shouldSleep;
     }
     if (shouldSleep)
     {
         OnSleep.Invoke();
     }
     else
     {
         OnWake.Invoke();
     }
 }