Table of Contents

Class SwiftGameObjectPoolManager

A singleton-based manager for accessing and managing pooled GameObjects through a SwiftGameObjectPoolAsset.

public class SwiftGameObjectPoolManager
Inheritance
SwiftGameObjectPoolManager
Inherited Members

Properties

Shared

Gets the shared singleton instance of the object pooler.

public static SwiftGameObjectPoolManager Shared { get; }

Property Value

SwiftGameObjectPoolManager

Methods

GetObject(string)

Gets a pooled GameObject by ID.

public GameObject GetObject(string id)

Parameters

id string

The pool name.

Returns

GameObject

A pooled GameObject instance.

GetParentTransform()

Gets the parent transform managing all pooled objects.

public Transform GetParentTransform()

Returns

Transform

The parent transform.

ReleaseObject(string, GameObject)

Releases a pooled GameObject back into the specified pool.

public void ReleaseObject(string id, GameObject gameObject)

Parameters

id string

The pool name.

gameObject GameObject

The pooled instance to release.

TryGetObject(string, out GameObject)

Attempts to get a pooled GameObject by ID without throwing when the pool is missing or exhausted.

public bool TryGetObject(string id, out GameObject gameObject)

Parameters

id string

The pool name.

gameObject GameObject

The pooled GameObject instance when successful.

Returns

bool

true when an object was acquired; otherwise false.