private void Clear() { for (int i = 0; i < _createdCount; i++) { _created[i].PoolReturning -= PoolItemReturn; _created[i].PoolRemoving -= Remove; _created[i] = null; } _createdCount = 0; if (_poolStack != null) { _poolStack.Clear(); _poolStack = null; } }
public PoolLazyItems(int poolCapacity) { _poolStack = new PoolStack(poolCapacity); _created = new IPoolable[poolCapacity]; }