Click or drag to resize

Pool Class

A Pool represents all the instances of a particular component (and its GameObject).
Inheritance Hierarchy
SystemObject
  Object
    Component
      Behaviour
        MonoBehaviour
          Kit.PoolingPool

Namespace:  Kit.Pooling
Assembly:  Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0
Syntax
C#
public class Pool : MonoBehaviour, IEnumerable<Component>, 
	IEnumerable
Request Example View Source

The Pool type exposes the following members.

Properties
  NameDescription
Public propertyAvailableCount
Number of instances that can be re-used.
Public propertyIsDestroying
Returns whether the pool is being destroyed.
Public propertyUsedCount
Number of instances that are in use.
Top
Methods
  NameDescription
Public methodDestroy
Pool a particular instance.
Public methodDestroyAll
Pool all instances.
Public methodGetEnumerator
Public methodInstantiate
Initialize a pool instance.
Public methodInstantiate(Vector3)
Initialize a pool instance.
Public methodInstantiate(Transform, Boolean)
Initialize a pool instance.
Public methodInstantiate(Vector3, Quaternion)
Initialize a pool instance.
Public methodInstantiate(Vector3, Transform)
Initialize a pool instance.
Public methodInstantiate(Vector3, Quaternion, Transform)
Initialize a pool instance.
Public methodInstantiateT
Initialize a pool instance.
Public methodInstantiateT(Vector3)
Initialize a pool instance.
Public methodInstantiateT(Transform, Boolean)
Initialize a pool instance.
Public methodInstantiateT(Vector3, Quaternion)
Initialize a pool instance.
Public methodInstantiateT(Vector3, Transform)
Initialize a pool instance.
Public methodInstantiateT(Vector3, Quaternion, Transform)
Initialize a pool instance.
Public methodPreloadInstances
Start preloading instances. Automatically gets called if Preload is .
Top
Events
  NameDescription
Public eventInstanceCreated
Event fired when a new instance is Instantiate-d with this pool.
Public eventInstancePooled
Event fired when an instance is pooled.
Public eventInstanceUsed
Event fired when an instance is initialized with this pool.
Top
Fields
  NameDescription
Public fieldAvailable
A list of all instances that can be re-used.
Public fieldStatic memberDestroyMessage
Message to send on instance pooling when PoolMessageMode is SendMessage or BroadcastMessage.
Public fieldStatic memberInstantiateMessage
Message to send on instance initialization when PoolMessageMode is SendMessage or BroadcastMessage.
Public fieldLimit
Limit the pool to a certain number of instances.
Public fieldLimitAmount
Number of instances to cap the pool to.
Public fieldLimitMode
What to do when the pool limit is reached?
Public fieldMessageMode
How an instance gets informed of pooling events?
Public fieldOrganize
Whether to organize instances for a cleaner scene hierarchy? Disable this if you want to set the parent of your instances manually.
Public fieldPersistent
Keep this pool persistent across scenes.
Public fieldPrefab
The prefab to pool instances of. The particular component is important as that's the component you will get when initializing an instance.
Public fieldPreload
Whether to pre-instantiate a certain of number of instances for future use.
Public fieldPreloadAmount
How many instances to instantiate for pre-loading?
Public fieldPreloadDelay
How many seconds to wait before starting to pre-load?
Public fieldPreloadTime
How many seconds to divide the pre-loading over?
Public fieldUsed
A list of all instances that are in use.
Top
Extension Methods
  NameDescription
Public Extension MethodDestroy
Destroy the object.
(Defined by UnityObjectExtensions.)
Public Extension MethodDisable
Set the enabled property to .
(Defined by BehaviourExtensions.)
Public Extension MethodEnable
Set the enabled property to .
(Defined by BehaviourExtensions.)
Public Extension MethodForEachComponent
Perform an action on a enumerable of items.
(Defined by EnumerableExtensions.)
Public Extension MethodGetBounds

Returns the bounds of the Component.

(Defined by ComponentExtensions.)
Public Extension MethodIndexOfComponent(Component)Overloaded.
Return the index of an item, or -1 if not found.
(Defined by EnumerableExtensions.)
Public Extension MethodIndexOfComponent(Component, IEqualityComparerComponent)Overloaded.
Return the index of an item, or -1 if not found.
(Defined by EnumerableExtensions.)
Public Extension MethodIsPrefab
Returns whether the Component is a part of a prefab.
(Defined by ComponentExtensions.)
Public Extension MethodLogComponent
Log all the items in enumerable to the Console.
(Defined by EnumerableExtensions.)
Public Extension MethodWithIndexComponent
Allows to traverse over an enumerable along with the indices of items.
(Defined by EnumerableExtensions.)
Top
See Also