Pool Class |
Namespace: Kit.Pooling
The Pool type exposes the following members.
| Name | Description | |
|---|---|---|
| AvailableCount | Number of instances that can be re-used. | |
| IsDestroying | Returns whether the pool is being destroyed. | |
| UsedCount | Number of instances that are in use. |
| Name | Description | |
|---|---|---|
| Destroy | Pool a particular instance. | |
| DestroyAll | Pool all instances. | |
| GetEnumerator | ||
| Instantiate | Initialize a pool instance. | |
| Instantiate(Vector3) | Initialize a pool instance. | |
| Instantiate(Transform, Boolean) | Initialize a pool instance. | |
| Instantiate(Vector3, Quaternion) | Initialize a pool instance. | |
| Instantiate(Vector3, Transform) | Initialize a pool instance. | |
| Instantiate(Vector3, Quaternion, Transform) | Initialize a pool instance. | |
| InstantiateT | Initialize a pool instance. | |
| InstantiateT(Vector3) | Initialize a pool instance. | |
| InstantiateT(Transform, Boolean) | Initialize a pool instance. | |
| InstantiateT(Vector3, Quaternion) | Initialize a pool instance. | |
| InstantiateT(Vector3, Transform) | Initialize a pool instance. | |
| InstantiateT(Vector3, Quaternion, Transform) | Initialize a pool instance. | |
| PreloadInstances | Start preloading instances. Automatically gets called if Preload is . |
| Name | Description | |
|---|---|---|
| InstanceCreated | Event fired when a new instance is Instantiate-d with this pool. | |
| InstancePooled | Event fired when an instance is pooled. | |
| InstanceUsed | Event fired when an instance is initialized with this pool. |
| Name | Description | |
|---|---|---|
| Available | A list of all instances that can be re-used. | |
| DestroyMessage | ||
| InstantiateMessage | ||
| Limit | Limit the pool to a certain number of instances. | |
| LimitAmount | Number of instances to cap the pool to. | |
| LimitMode | What to do when the pool limit is reached? | |
| MessageMode | How an instance gets informed of pooling events? | |
| Organize |
Whether to organize instances for a cleaner scene hierarchy? Disable this if you want to set the parent of your instances
manually.
| |
| Persistent | Keep this pool persistent across scenes. | |
| Prefab |
The prefab to pool instances of. The particular component is important as that's the component you will get when initializing an
instance.
| |
| Preload | Whether to pre-instantiate a certain of number of instances for future use. | |
| PreloadAmount | How many instances to instantiate for pre-loading? | |
| PreloadDelay | How many seconds to wait before starting to pre-load? | |
| PreloadTime | How many seconds to divide the pre-loading over? | |
| Used | A list of all instances that are in use. |
| Name | Description | |
|---|---|---|
| Destroy | Destroy the object. (Defined by UnityObjectExtensions.) | |
| Disable | Set the enabled property to . (Defined by BehaviourExtensions.) | |
| Enable | Set the enabled property to . (Defined by BehaviourExtensions.) | |
| ForEachComponent | Perform an action on a enumerable of items. (Defined by EnumerableExtensions.) | |
| GetBounds | Returns the bounds of the Component. | |
| IndexOfComponent(Component) | Overloaded. Return the index of an item, or -1 if not found. (Defined by EnumerableExtensions.) | |
| IndexOfComponent(Component, IEqualityComparerComponent) | Overloaded. Return the index of an item, or -1 if not found. (Defined by EnumerableExtensions.) | |
| IsPrefab | Returns whether the Component is a part of a prefab. (Defined by ComponentExtensions.) | |
| LogComponent | Log all the items in enumerable to the Console. (Defined by EnumerableExtensions.) | |
| WithIndexComponent | Allows to traverse over an enumerable along with the indices of items. (Defined by EnumerableExtensions.) |