Class ComponentPool<T>
Component pool. Provided prefab instance will be used as a source for component entities.
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ToString()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: StansAssets.Foundation.Patterns
Assembly: cs.temp.dll.dll
Syntax
public class ComponentPool<T> : ObjectPool<T> where T : Component
Type Parameters
Name | Description |
---|---|
T | The type of Component on the prefab root. |
Constructors
ComponentPool(GameObject, Action<T>, Action<T>, Int32)
Component source pool default implementation will use
Declaration
public ComponentPool(GameObject sourcePrefab, Action<T> onGet, Action<T> onRelease, int defaultCapacity = 10)
Parameters
Type | Name | Description |
---|---|---|
GameObject | sourcePrefab | The prefab instance you would like to use as a source for T. |
System.Action<T> | onGet | Action that will be called when pool entity is created. |
System.Action<T> | onRelease | Action that will be called when pool entity is released. |
System.Int32 | defaultCapacity | The default capacity the stack will be created with. |
ComponentPool(GameObject, Int32)
ComponentPool<T> default implementation will use
Declaration
public ComponentPool(GameObject sourcePrefab, int defaultCapacity = 10)
Parameters
Type | Name | Description |
---|---|---|
GameObject | sourcePrefab | The prefab instance you would like to use as a source for T. |
System.Int32 | defaultCapacity | The default capacity the stack will be created with. |