GameObjectCreator Class

Definition

An abstract class used by the GameObjectPool for creating and recycling game objects.

C++
public ref class GameObjectCreator abstract
Inheritance
GameObjectCreator
Derived

Constructors

Methods

Instantiate()

Creates a GameObject for the GameObjectPool. The position and rotation of the GameObject is set by the GameObjectPool when GetGameObject is called.

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.

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.

Applies to

Product Versions
MRTK2 Unity 2018 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0
MRTK2 Unity 2019 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0, 2.8.0
MRTK2 Unity 2020 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0, 2.8.0