/// <summary> /// Releases all currently spawned objects of all types. /// </summary> public void ReleaseAll() { foreach (KeyValuePair <string, FactoryData> itm in mFactory) { FactoryData factory = itm.Value; for (int i = 0; i < factory.actives.Count; i++) { PoolDataController pdc = factory.actives[i]; pdc.Despawn(); factory.Release(pdc, false); } factory.actives.Clear(); } }
/// <summary> /// Releases all currently spawned objects of all types. /// </summary> public void ReleaseAll() { foreach (KeyValuePair <string, FactoryData> itm in mFactory) { FactoryData factory = itm.Value; for (int i = 0; i < factory.actives.Count; i++) { PoolDataController pdc = factory.actives[i]; pdc.SendMessage(OnDespawnMessage, null, SendMessageOptions.DontRequireReceiver); factory.Release(pdc, false); } factory.actives.Clear(); } }