Ultimate Pooling Scripting Reference
PoolGroup Class |
Represents a spawn pool for a specfific type of prefab.
Valid types are game objects and components.

SystemObject Object
Component
Behaviour
MonoBehaviour
UltimatePoolingPoolGroup
UltimatePoolingGenericPoolGroup
Component
Behaviour
MonoBehaviour
UltimatePoolingPoolGroup
UltimatePoolingGenericPoolGroup
Namespace: UltimatePooling
Assembly: Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0.0.0

public abstract class PoolGroup : MonoBehaviour
UltimatePooling.PoolGroup = function(); Type.createClass( 'UltimatePooling.PoolGroup', UnityEngine.MonoBehaviour);
The PoolGroup type exposes the following members.


Name | Description | |
---|---|---|
![]() | despawn(Object) |
Indicates that the specified instance can be returned to the pool and re-used at a later time.
|
![]() | despawn(Object, Single) |
Indicates that the specified instance can be returned to the pool and re-used at a later time.
|
![]() | despawnAll |
Attempts to reclaim all instances spawned by this pool and return them to the pool.
Any instances spawned by this pool will be forcefully returned without warning.
|
![]() | despawnAll(Single) |
Attempts to reclaim all instances spawned by this pool after the specified time delay.
Any instances spawned by this pool will be forcefully returned without warning.
|
![]() | destroy |
Attempts to destroy a specific instance from the pool.
Note that 'OnDespawn' will not be called on the instance. Instead you should handle any cleanup in 'OnDestroy'
|
![]() | destroyAll |
Attempts to destroy all pooled objects effectivley emptying the pool and resetting its state.
Note that 'OnDespawn' will not be called on the pooled objects. Instead you should handle any cleanup in 'OnDestroy'
|
![]() | destroySelf |
Attempts to destroy all pooled objects effectivley emptying the pool as well as destroying the pool instance.
This is the prefered way of destroying an object pool as it allows the spawned objects to remain in the scene if required as opposed to being destroyed along with the pool.
Note that 'OnDespawn' will not be called on any of the pooled objects. Instead you should handle any cleanup in 'OnDestroy'
|
![]() | didSpawn |
Returns true if this spawn group created the instance specified.
Useful for spawn validation to make sure multiple pools are not attempting to manage the same instance.
|
![]() | onInstanceDespawned |
Should be implemented by the inheriting class.
Called when the object is about to be returned to the pool.
|
![]() | onInstanceSpawned |
Should be implemented by the inheriting class.
Called when the object has been taken from the pool and will be re-used.
|
![]() | spawn |
Spawn an instance from the pool.
|
![]() | spawn(Vector3, Quaternion) |
Spawn an instance from the pool using the specified position and rotation.
|
![]() | Start |
Called by Unity on the first frame.
|
![]() | ToString |
Override the string value to return detaild state information about the pool.
(Overrides Object.ToString.) |

Name | Description | |
---|---|---|
![]() | eventType |
The method used to inform a spawned instance when it is added to or removed from the pool.
|
![]() | maxAmount |
The max amount of instances that the pool can contain. If this amount is exceeded then the pool will need to destroy some objects.
|
![]() | parentInstances |
When true, all spawned instances will be added as child objects to the managing pool group.
|
![]() | pooled |
A collection of objects that are ready to be spawned.
|
![]() | prewarmAmount |
The amount of inctances to preload.
|
![]() | prewarmPerFrame |
The max amount of instances to preload per frame.
|
![]() | prewarmPool |
Should the pool preload a set number of objects at startup.
This can avoid frame spikes cause by calls to 'Instantiate' but may increase loading time.
|
![]() | tracked |
A collection of objects that have been spawned by this pool.
|

Name | Description | |
---|---|---|
![]() | IsFull |
Returns true if the pool is unable to store anymore pooled instances.
|
![]() | IsPrewarming |
Returns true if the pool is currently prewarming.
|
![]() | Prefab |
Should be implemented by the inheritng class.
Should return the specific prefab type, For example 'GameObject'.
|
