public static void Deactivate() { for (int i = 0; i < PeakGlobalID; i++) { if (GlobalAgentActive [i]) { DestroyAgent(GlobalAgents [i], true); } } CheckDestroyAgent(); for (int i = 0; i < DeathingAgents.PeakCount; i++) { if (DeathingAgents.arrayAllocation [i]) { LSAgent agent = DeathingAgents [i]; agent.Pool(); } } DeathingAgents.FastClear(); }