poolManager
: PoolManager< GameObject, Pool< GameObject > > |
Signature
PoolManager<GameObject, Pool<GameObject> > poolManager |
DEFAULT_CALLBACKS
: readonly Pool< GameObject >.Callbacks |
Signature
readonly Pool<GameObject>.Callbacks DEFAULT_CALLBACKS |
Create
(
primitive
, position
, rotation
, anchor
, parent
)
|
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.
Signature
GameObject Create(GameObject primitive, Vector3 position, Quaternion rotation, MRUKAnchor anchor, Transform parent=null) Parameters primitive: GameObject
The primitive to use
position: Vector3
Position of the object to instatiate
rotation: Quaternion
Rotation of the object to instatiate
parent: Transform
The Parent object to attach to.
Returns GameObject
The instantiated gameobject
|
Create
(
primitive
, anchor
, parent
, instantiateInWorldSpace
)
|
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.
Signature
GameObject Create(GameObject primitive, MRUKAnchor anchor, Transform parent=null, bool instantiateInWorldSpace=false) Parameters primitive: GameObject
The primitive to use
parent: Transform
The Parent object to attach to.
instantiateInWorldSpace: bool
Define if it should staz in worldspace
Returns GameObject
The instantiated gameobject
|
Create< T >
(
primitive
, position
, rotation
, anchor
, parent
)
|
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.
Signature
T Create< T >(T primitive, Vector3 position, Quaternion rotation, MRUKAnchor anchor, Transform parent=null) Parameters primitive: T
The primitive object used to create the new GameObject.
position: Vector3
The position of the new GameObject in world space.
rotation: Quaternion
The rotation of the new GameObject in world space.
parent: Transform
An optional parent Transform for the new GameObject. Defaults to null.
Returns T
The newly created component instance, or null if creation failed.
|
Create< T >
(
primitive
, anchor
, parent
, instantiateInWorldSpace
)
|
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.
Signature
T Create< T >(T primitive, MRUKAnchor anchor, Transform parent=null, bool instantiateInWorldSpace=false) Parameters primitive: T
The primitive object used to create the new GameObject.
parent: Transform
An optional parent Transform for the new GameObject. Defaults to null.
instantiateInWorldSpace: bool
If true, the new GameObject will be instantiated in world space instead of local space. Defaults to false.
Returns T
The newly created component instance, or null if creation failed.
|
Release
(
go
)
|
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.
Signature
void Release(GameObject go) Parameters go: GameObject
The GameObject to release.
Returns void |
GetPoolCallbacks
()
|
Gets the callbacks for the GameObject pool.
Signature
abstract Pool< GameObject >.Callbacks GetPoolCallbacks() Returns abstract Pool< GameObject >.Callbacks
An instance of Pool<GameObject>.Callbacks containing the callback methods for the GameObject pool.
|