예제 #1
0
 public void DeSpawn(BanditController bandit)
 {
     _pool.Release(bandit);
 }
예제 #2
0
 public BanditPool(BanditController prefab, int maxSize = 50)
 {
     _pool = new ObjectPool <BanditController>(() => Object.Instantiate(prefab), actionOnDestroy: bandit => Object.Destroy(bandit.gameObject), maxSize: maxSize);
 }