- Object-Pooling for game unity is very easy to use
for version 1.0.1
"com.wolf-org.object-pooling":"https://github.com/unity-package/object-pooling-unity.git#1.0.1",
- Init Pool
Pool.InitPool();
- Spawn/DeSpawn Object
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();
}