Exemplo n.º 1
0
 public PoolObject GetPoolObjectOfType(PoolObject.PoolObjectType pooltype, Vector3 initialPosition)
 {
     if (pools.ContainsKey(pooltype))
     {
         Pool pool = pools[pooltype];
         if (pool.FreeObjects.Count > 0)
         {
             PoolObject poolObject = pool.FreeObjects[0];
             poolObject.GetPoolObject(initialPosition);
             pool.FreeObjects.Remove(poolObject);
             pool.UsedObjects.Add(poolObject);
             return(poolObject);
         }
     }
     return(null);
 }