Object Pooling 1.2.0
Simple Object Pooling system for Unity Game Objects. It instantiates a pool of prefabs and manages their lifecycle.
Loading...
Searching...
No Matches
MegaCrush.ObjectPool.PoolManager Class Reference

Simple pooling system for GameObjects. More...

Inheritance diagram for MegaCrush.ObjectPool.PoolManager:

Static Public Member Functions

static void AddNewObjectPool (PoolObjectSetting thisObject)
 Register a new pool and pre-instantiate its objects.
 
static GameObject GetInstance (GameObject prefab)
 Get an instance by prefab reference. Expands if exhausted.
 
static GameObject GetInstance (string name)
 Get an instance by pool name (prefab name).
 
static void ReturnInstance (GameObject instance)
 Return an instance to the pool.
 
static string GetObjectName (GameObject prefab)
 Cached prefab name (avoids GC).
 

Properties

static bool IsWarming [get]
 True while the pool is instantiating (warmup/expansion). Helpful as a guard if any legacy logic still runs in OnEnable.
 

Detailed Description

Simple pooling system for GameObjects.

Member Function Documentation

◆ AddNewObjectPool()

static void MegaCrush.ObjectPool.PoolManager.AddNewObjectPool ( PoolObjectSetting thisObject)
static

Register a new pool and pre-instantiate its objects.

◆ GetInstance() [1/2]

static GameObject MegaCrush.ObjectPool.PoolManager.GetInstance ( GameObject prefab)
static

Get an instance by prefab reference. Expands if exhausted.

◆ GetInstance() [2/2]

static GameObject MegaCrush.ObjectPool.PoolManager.GetInstance ( string name)
static

Get an instance by pool name (prefab name).

◆ GetObjectName()

static string MegaCrush.ObjectPool.PoolManager.GetObjectName ( GameObject prefab)
static

Cached prefab name (avoids GC).

◆ ReturnInstance()

static void MegaCrush.ObjectPool.PoolManager.ReturnInstance ( GameObject instance)
static

Return an instance to the pool.

In addition to disabling the instance, any UnityEngine.AI.NavMeshAgent on the instance is explicitly disabled to ensure safe re-checkout and placement by runtime systems.

Property Documentation

◆ IsWarming

bool MegaCrush.ObjectPool.PoolManager.IsWarming
staticget

True while the pool is instantiating (warmup/expansion). Helpful as a guard if any legacy logic still runs in OnEnable.


The documentation for this class was generated from the following file: