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); }
private PoolItem GetPoolItem(PoolingId id) { return(itemsToPool[itemsToPool.FindIndex(x => id == x.PoolingId)]); }
public List <GameObject> GetAllReferencesOf(PoolingId poolingId) { return(_pool[poolingId]); }