public void ReturnAll() { for (int i = activeObjects.Count - 1; i >= 0; i--) { IPooled pooled = activeObjects[i] as IPooled; pooled.ReturnToPool(); } }
private void AddInstanceToPool() { IPooled item = createInstanceHandler(); item.Init(this); activeItems.Add(item); item.ReturnToPool(); }