private void Reset(BunkerPoolList key, GameObject obj)
        {
            GameObjectPool <GameObject> pool = bunkerPoolDictionary[key];

            obj.SetActive(false);
            pool.push(obj);
        }
 public void Remove(BunkerPoolList key, GameObject obj)
 {
     if (activeList.Remove(obj))
     {
         Debug.Log("Count " + activeList.Count + "key " + key);
         Reset(key, obj);
     }
 }
        public GameObject Pop(BunkerPoolList key)
        {
            GameObjectPool <GameObject> pool = bunkerPoolDictionary[key];
            GameObject obj = pool.pop();

            obj.SetActive(true);
            activeList.Add(obj);
            return(obj);
        }
Ejemplo n.º 4
0
        public void WillBuildBunker(BunkerPoolList towerKey)
        {
            var obj = BunkerObjectPool.Instance.Pop(towerKey).GetComponent <Building>();

            WillBuildSetup((int)towerKey, obj);
        }