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