public void SetupNewPool <T>(PoolSettings settings) where T : MonoBehaviour, IPoolable { if (nextPoolIndex >= poolBuffer.Length) { throw new PoolException("[Pooler] Setup Pool: Max capacity Reached. Increase pooler size."); } var pool = new GenericPool <T>(settings); poolBuffer[nextPoolIndex] = pool; prefabBuffer[nextPoolIndex] = settings.Prefab.GetHashCode(); if (!isBackOffTimerRunning) { backoffTimer = new CountdownTimer("BackofftimerID", providerPoolRefreshTime, Domain.Enum.CountdownScope.Game, true, (id) => OnBackoffTimer(id), null); StartBackoffUpdateTimer(); isBackOffTimerRunning = true; } nextPoolIndex++; }
public GenericPool(PoolSettings settings) : base(settings) { allLookup = new Dictionary <GameObject, T>(); inUnused = new Queue <T>(); }
public PoolBase(PoolSettings settings) { this.settings = settings; outInuse = new HashSet <GameObject>(); }