Class GameObjectCreator
An abstract class used by the GameObjectPool for creating and recycling game objects.
Inherited Members
Namespace: Microsoft.MixedReality.Toolkit.Utilities.GameObjectManagement
Assembly: cs.temp.dll.dll
Syntax
public abstract class GameObjectCreator
Methods
Instantiate()
Creates a GameObject for the GameObjectPool. The position and rotation of the GameObject is set by the GameObjectPool when GetGameObject is called.
Declaration
public abstract GameObject Instantiate()
Returns
Type | Description |
---|---|
GameObject | An instantiated GameObject. |
PrepareForRecycle(GameObject)
Called when the GameObject is about to be recycled by the GameObjectPool. This allows you to potentially free up any resources before it is deactivated by the GameObjectPool. If the GameObject has a component that implements the IGameObjectCreatorHandler interface, it will call its PrepareForRecycle function.
Declaration
public virtual void PrepareForRecycle(GameObject obj)
Parameters
Type | Name | Description |
---|---|---|
GameObject | obj | The GameObject that is about to be recycled. |
PrepareForUse(GameObject)
Called before the GameObject's position and rotation are set (as well as its active state) by the GameObjectPool when GetGameObject is called. If the GameObject has a component that implements the IGameObjectCreatorHandler interface, it will call its PrepareForUse function.
Declaration
public virtual void PrepareForUse(GameObject obj)
Parameters
Type | Name | Description |
---|---|---|
GameObject | obj | The GameObject that is about to be used. |