Class ObjectPool<T>
Provides a generic object pool implementation.
Inherited Members
Namespace: Unity.XR.CoreUtils
Assembly: solution.dll
Syntax
public class ObjectPool<T> where T : class, new()
Type Parameters
Name | Description |
---|---|
T | The Type of objects in this pool. |
Fields
Name | Description |
---|---|
PooledQueue | All objects currently in this pool. |
Methods
Name | Description |
---|---|
ClearInstance(T) | Implement this function in a derived class to automatically clear an instance when Recycle(T) is called. |
Get() | Gets an object instance from the pool. Creates a new instance if the pool is empty. |
Recycle(T) | Returns an object instance to the pool. |