Пример #1
0
        /// <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];

                    if (despawnCallback != null)
                    {
                        despawnCallback(pdc);
                    }

                    pdc.Despawn();

                    factory.ReleaseIgnoreActiveList(pdc);
                }

                factory.actives.Clear();
            }
        }