コード例 #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]);
 }