API reference
API reference
Select your platform
No SDKs available
No versions available

PoolManagerComponent Class

Extends MonoBehaviour
This component is responsible for managing the pooling of GameObjects.

Public Statics

static readonly Pool< GameObject >.Callbacks DEFAULT_CALLBACKS[Get]

Fields

PoolManager< GameObject, Pool< GameObject > > poolManager[Get]

Member Functions

Create is a drop-in replacement for Instantiate that uses a pool if available.
Note that it is not named Instantiate so that it is easy to find & replace Instantiate calls with Create calls when switching to using Pools.
Parameters
primitive
The primitive to use
position
Position of the object to instatiate
rotation
Rotation of the object to instatiate
anchor
The MRUKAnchor to associate with.
parent
The Parent object to attach to.
Returns
The instantiated gameobject
Create is a drop-in replacement for Instantiate that uses a pool if available.
Note that it is not named Instantiate so that it is easy to find & replace Instantiate calls with Create calls when switching to using Pools.
Parameters
primitive
The primitive to use
anchor
The MRUKAnchor to associate with.
parent
The Parent object to attach to.
instantiateInWorldSpace
Define if it should staz in worldspace
Returns
The instantiated gameobject
Creates a new instance of the specified component type, attached to a GameObject created from the given primitive.
The GameObject is positioned and rotated according to the provided parameters, and optionally parented to another Transform.
Parameters
primitive
The primitive object used to create the new GameObject.
position
The position of the new GameObject in world space.
rotation
The rotation of the new GameObject in world space.
anchor
The MRUKAnchor to which the new GameObject will be attached.
parent
An optional parent Transform for the new GameObject. Defaults to null.
Others
T
The type of component to create and attach to the new GameObject.
Returns
The newly created component instance, or null if creation failed.
Creates a new instance of the specified component type, attached to a GameObject created from the given primitive.
The GameObject is positioned and rotated according to the provided MRUKAnchor, and optionally parented to another Transform.
Parameters
primitive
The primitive object used to create the new GameObject.
anchor
The MRUKAnchor to which the new GameObject will be attached.
parent
An optional parent Transform for the new GameObject. Defaults to null.
instantiateInWorldSpace
If true, the new GameObject will be instantiated in world space instead of local space. Defaults to false.
Others
T
The type of component to create and attach to the new GameObject.
Returns
The newly created component instance, or null if creation failed.
Releases a previously created GameObject back to its pool, or destroys it if it's not poolable.
This method is used to return a GameObject to its original state and make it available for reuse.
Parameters
go
The GameObject to release.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon