PoolGroup Methods

Ultimate Pooling

PoolGroup Methods

The PoolGroup type exposes the following members.

Methods
  Name Description
Public method despawn(Object)
Indicates that the specified instance can be returned to the pool and re-used at a later time.
Public method despawn(Object, Single)
Indicates that the specified instance can be returned to the pool and re-used at a later time.
Public method 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.
Public method 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.
Public method 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'
Public method 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'
Public method 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'
Public method 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.
Protected method onInstanceDespawned
Should be implemented by the inheriting class. Called when the object is about to be returned to the pool.
Protected method onInstanceSpawned
Should be implemented by the inheriting class. Called when the object has been taken from the pool and will be re-used.
Public method spawn
Spawn an instance from the pool.
Public method spawn(Vector3, Quaternion)
Spawn an instance from the pool using the specified position and rotation.
Protected method Start
Called by Unity on the first frame.
Public method ToString
Override the string value to return detaild state information about the pool.
(Overrides Object.ToString.)
Top
See Also