public void Remove(TablePoolList key, GameObject obj) { if (activeList.Remove(obj)) { Reset(key, obj); } }
private void Reset(TablePoolList key, GameObject obj) { GameObjectPool <GameObject> pool = tablePoolDictionary[key]; pool.push(obj); obj.SetActive(false); }
public GameObject Pop(TablePoolList key) { GameObjectPool <GameObject> pool = tablePoolDictionary[key]; GameObject obj = pool.pop(); activeList.Add(obj); return(obj); }
public void WillBuildTable(TablePoolList towerKey) { var obj = TableObjectPool.Instance.Pop(towerKey).GetComponent <Building>(); WillBuildSetup((int)towerKey, obj); }