Skip to content

Pooling.SendToPool

Andrés Eduardo Maldonado edited this page Jun 14, 2019 · 2 revisions

Static method from Pooling.

Description

Collects the object to its pool then deactivates it, ready for next use. If it doesn't have a pool, it will be destroyed. A message in the console should confirm this.
This will call IPoolable.OnPoolUnSpawn.

Usage

// Called when we are done with this object.
public void Teminate()
{
    Pooling.SendToPool(gameObject);
}

Method signature

static public void SendToPool(GameObject obj)
Type Argument Description
GameObject obj The Game Object to take back.