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