Click or drag to resize

GameObjectPoolT Class

A generic object pool.
Inheritance Hierarchy
SystemObject
  RavingBots.MagicGestures.Utils.ObjectPoolingGameObjectPoolT

Namespace:  RavingBots.MagicGestures.Utils.ObjectPooling
Assembly:  Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0.0.0
Syntax
C#
public class GameObjectPool<T> : IObjectPool
where T : MonoBehaviour, IPooledObject

Type Parameters

T
The type of the component.

The GameObjectPoolT type exposes the following members.

Constructors
Properties
  NameDescription
Private propertyContainer
The scene container that keeps the created objects.
Top
Methods
  NameDescription
Public methodPrecache
Prepare some instances before they're actually needed.
Public methodRevokeInstance
Return an instance to the pool.
Public methodTakeInstance
Take an instance out of the pool.
Top
Fields
  NameDescription
Private field_container
The scene container that keeps the created objects.
Private field_prefab
The prefab used to create new instances.
Private field_queue
The queue of cached instances.
Top
Remarks
Pooling is used for objects that are created frequently, but don't live very long (like the spell effects) to lower the allocation rate and avoid unnecessary collections of reusable instances, and to speed things up (as creating new instances can be expensive).
See Also