Code Reference‎ > ‎PoolManager‎ > ‎

PoolManager.Pools[]

class Pools["poolName"] : IDictionary

returns: SpawnPool

Description
Pools is the primary means for accessing PoolManager's SpawnPools. 

Note the use of square brackets when providing the name of a pool:

// Print the number of spawned instances in a pool called "Enemies"
Debug.Log(PoolManager.Pools["Enemies"].Count());


Class Members

 AddOnCreatedDelegateRegisters a C# method to be run when the Pool is created. Solves Awake() races.
 ContainsKey
Returns true if Pools contains a SpawnPool with the given name. See also TryGetValue.
 ContainsValueReturns true if Pools contains a SpawnPool reference.
 Count
Return the number of SpawnPools in Pools
 CreateCreates a new SpawnPool
 Destroy
Destroys an entire SpawnPool. This MUST be used if destroying a pool to recreate it in the same frame (before Unity clears its destroy queue). Otherwise, this is just a convinince to destroy a pool by name. You can also just use GameObject.Destroy(...)
 DestroyAllDestroy ALL SpawnPool
 ToStringReturns a nice clean list of all the pool names. This is already used in message logging.
 TryGetValue Use this to get a reference to a SpawnPool when you aren't sure if it exists. This is faster than using Contains to test then getting the pool directly.