Code Reference‎ > ‎


class SpawnPool : List<Transform>

SpawnPools handle most of the PoolManager functionality by managing PrefabPools. SpawnPools are almost always accessed via the PoolManager.Pools dictionary.

SpawnPools are also a special list class which can provide easy access to only the spawned instances in your game. See the Example Patterns section for more advanced implementation ideas.

Class Members

 CreatePrefabPoolCreates a new PrefabPool in a SpawnPool to allow prefab-specific options such as instance 
 CountReturns the number of instances currently spawned.
 DespawnIf the passed transform is managed by the SpawnPool, it will be deactivated and made available to be respawned.
 GetPrefabReturns the prefab used to create the passed instance. This is provided for convenience as Unity doesn't offer this feature.
 groupThe SpawnPool's 'Group' is the GameObject which has the SpawnPool component and is the default parent of all instances in the pool.
 logMessageTurn this on to see messages printed to the Unity Console
 matchPoolLayer Matches new instances to the SpawnPool GameObject's layer.
 matchPoolScale Matches new instances to the SpawnPool GameObject's scale.
 poolNameThe name of the pool. Used to access the pool via PoolManager.Pools[poolName]
 prefabPoolsAccess to the prefabPools to get information related to a particular prefab.
 prefabsAccess to the prefabs cached in the SpawnPool.
 Spawn Use Spawn() instead of Unity's Instantiate().
 ToStringReturns a list of the names of instances currently spawned.