Show / Hide Table of Contents

Class ComponentPool<T>

Component pool. Provided prefab instance will be used as a source for component entities.

Inheritance
System.Object
ObjectPool<T>
ComponentPool<T>
Inherited Members
ObjectPool<T>.CountAll
ObjectPool<T>.CountActive
ObjectPool<T>.CountInactive
ObjectPool<T>.PreWarm(Int32)
ObjectPool<T>.Get()
ObjectPool<T>.TryGet(Predicate<T>, T)
ObjectPool<T>.Get(T)
ObjectPool<T>.Release(T)
ObjectPool<T>.Clear()
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 and action declaration is your responsibility.

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 as the create action, and when pool entity is taken or released.

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.

In This Article
Back to top Generated by DocFX