Пример #1
0
        internal void SelfDestruct()
        {
            this.prefab    = null;
            this.prefabGO  = null;
            this.spawnPool = null;

            foreach (Transform inst in this._despawned)
            {
                if (inst != null)
                {
                    Object.Destroy(inst.gameObject);
                }
            }

            foreach (Transform inst in this._spawned)
            {
                if (inst != null)
                {
                    Object.Destroy(inst.gameObject);
                }
            }

            this._spawned.Clear();
            this._despawned.Clear();
        }
Пример #2
0
        internal bool Remove(SpawnPool spawnPool)
        {
            if (!this.ContainsKey(spawnPool.poolName))
            {
                LitLogger.WarningFormat(string.Format("Pool not in PoolManager: {0}", spawnPool.poolName));
                return(false);
            }

            this._pools.Remove(spawnPool.poolName);
            return(true);
        }
Пример #3
0
        internal void Add(SpawnPool spawnPool)
        {
            if (this.ContainsKey(spawnPool.poolName))
            {
                LitLogger.WarningFormat(string.Format("A pool with the name '{0}' already exists. ", spawnPool.poolName));
                return;
            }

            this._pools.Add(spawnPool.poolName, spawnPool);
            TrrigerCreateEvent(spawnPool.name);
        }
Пример #4
0
 public bool TryGetValue(string poolName, out SpawnPool spawnPool)
 {
     return(this._pools.TryGetValue(poolName, out spawnPool));
 }