Ejemplo n.º 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();
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 4
0
 public bool TryGetValue(string poolName, out SpawnPool spawnPool)
 {
     return(this._pools.TryGetValue(poolName, out spawnPool));
 }