Skip to content

InstanceObjectCreator

Item creator that instantiates a prefab per Create and destroys the instance per Reclaim.

Namespace: Jungle.Objects Inherits: GameObjectCreatorControllableComponentMonoBehaviour Implements: IItemCreator<GameObject>

Overview

InstanceObjectCreator is the no-pooling, no-reuse variant of PooledObjectCreator. Each Create instantiates a new prefab; each Reclaim (or DestroyItem) destroys the instance.

Use this when you don't expect to recycle instances — short-lived spawns, one-shot effects, debug helpers. For workloads where instances are repeatedly acquired and released, prefer PooledObjectCreator.

Properties

Property Type Description
prefab GameObject Prefab to instantiate on each Create.
parent Transform Optional parent for instantiated objects. Uses this transform if unset.

Methods

Method Description
Create(Action<GameObject>) Instantiates the prefab and invokes the callback with the result.
Reclaim(GameObject, Action) Destroys the instance.
DestroyItem(GameObject) Destroys the instance immediately.

See Also