public StaticMemoryPoolBaseBase(Action <TValue> onDespawnedMethod) { _onDespawnedMethod = onDespawnedMethod; #if UNITY_EDITOR StaticMemoryPoolRegistry.Add(this); #endif }
void Construct( IFactory <TContract> factory, DiContainer container, [InjectOptional] MemoryPoolSettings settings) { _settings = settings ?? MemoryPoolSettings.Default; _factory = factory; _container = container; _inactiveItems = new Stack <TContract>(_settings.InitialSize); if (!container.IsValidating) { for (int i = 0; i < _settings.InitialSize; i++) { _inactiveItems.Push(AllocNew()); } } StaticMemoryPoolRegistry.Add(this); }
public StaticMemoryPoolBase(Action <TValue> onDespawnedMethod) { _onDespawnedMethod = onDespawnedMethod; StaticMemoryPoolRegistry.Add(this); }