public static SpawnPool Create(string poolName, GameObject owner) { SpawnPool spawnPool = owner.AddComponent <SpawnPool>(); spawnPool.PoolName = poolName; return(spawnPool); }
public static SpawnPool Create(string poolName) { GameObject owner = new GameObject(poolName + "Pool"); SpawnPool spawnPool = owner.AddComponent <SpawnPool>(); spawnPool.PoolName = poolName; return(spawnPool); }
internal static bool Remove(SpawnPool spawnPool) { if (!_pools.ContainsKey(spawnPool.PoolName)) { Debug.LogWarning($"Failed to remove {spawnPool.PoolName}, pool not in PoolManager"); return(false); } _pools.Remove(spawnPool.PoolName); Debug.Log($"Removed pool: {spawnPool.PoolName}"); return(true); }
internal static bool Add(SpawnPool spawnPool) { if (!_pools.ContainsKey(spawnPool.PoolName) & Application.isPlaying) { Debug.LogWarning($"A pool with the name {spawnPool.PoolName} already exists"); return(false); } _pools.Add(spawnPool.PoolName, spawnPool); Debug.Log($"Added pool: {spawnPool.PoolName}"); return(true); }
public static bool Contains(SpawnPool spawnPool) { return(_pools.ContainsValue(spawnPool)); }