-
Notifications
You must be signed in to change notification settings - Fork 2
Object Pooling
DucNV_2000 edited this page Jun 13, 2024
·
3 revisions
- Init Pool
Pool.InitPool();
Example
public GameObject prefab;
private GameObject ins;
void SpawnIns()
{
ins = Pool.Spawn(prefab);
}
void DeSpawnIns()
{
Pool.DeSpawn(ins);
}
Or
public GameObject prefab;
private GameObject ins;
void SpawnIns()
{
ins = prefab.Spawn();
}
void DeSpawnIns()
{
ins.DeSpawn();
}