Example #1
0
        public static SpawnPool Create(string poolName, GameObject owner)
        {
            SpawnPool spawnPool = owner.AddComponent <SpawnPool>();

            spawnPool.PoolName = poolName;

            return(spawnPool);
        }
Example #2
0
        public static SpawnPool Create(string poolName)
        {
            GameObject owner = new GameObject(poolName + "Pool");

            SpawnPool spawnPool = owner.AddComponent <SpawnPool>();

            spawnPool.PoolName = poolName;

            return(spawnPool);
        }
Example #3
0
        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);
        }
Example #4
0
        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);
        }
Example #5
0
 public static bool Contains(SpawnPool spawnPool)
 {
     return(_pools.ContainsValue(spawnPool));
 }