public void RemoveAgent(Transform agentTrans) { NavmeshAgentController agent = agentTrans.GetComponent <NavmeshAgentController>(); if (agent) { agent.SetAgentActive(true); agent.transform.SetParent(null); agents.Remove(agent); } }
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(); } }