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.
|