public sealed class TransformPool : ISelfCreatingNewObjectHandler<Transform>
Provides an implementation of the
ISelfCreatingNewObjectHandler
interface that handles Transform components.
This handler works by pooling the Transforms (which are attached to empty game objects)
under a deactivated parent in the scene,
and also allows you to specify a maximum number of transforms to keep in the pool.
Once that limit is reached, the
Transforms (and game objects) will be destroyed rather than pooled.
public void DespositObject(Transform obj)
Gives a transform object to the handler for pooling or destruction.
Name | Type | Description |
---|---|---|
obj | Transform |
The object to give to the handler. |
public Transform WithdrawObject()
Gets a transform object from the handler.
Transform
A Transform from the pool.