예제 #1
0
파일: Pool.cs 프로젝트: baransrc/Hexagon
    public GameObject GetPooledObject(PoolingId poolingId)
    {
        var currentList = _pool[poolingId];

        foreach (var item in currentList)
        {
            if (!item.activeInHierarchy)
            {
                item.SetActive(true);

                return(item);
            }
        }

        var gameObj = CreateObject(GetPoolItem(poolingId));

        gameObj.SetActive(true);

        return(gameObj);
    }
예제 #2
0
파일: Pool.cs 프로젝트: baransrc/Hexagon
 private PoolItem GetPoolItem(PoolingId id)
 {
     return(itemsToPool[itemsToPool.FindIndex(x => id == x.PoolingId)]);
 }
예제 #3
0
파일: Pool.cs 프로젝트: baransrc/Hexagon
 public List <GameObject> GetAllReferencesOf(PoolingId poolingId)
 {
     return(_pool[poolingId]);
 }