The PoolableObject type exposes the following members.


  Name Description
Public method PoolableObject
Initializes a new instance of the PoolableObject class


  Name Description
Public method DeactivateAllPoolableObjectsOfMyKind
Moves all poolable objects of this kind (instantiated from the same prefab as this instance) back to the pool.
Public method GetAllPoolableObjectsOfMyKind
Retrieves an array of all poolable objects of this kind (instantiated from the same prefab as this instance).
Public method GetSerialNumber
Gets the object's pool serial number. Each object has a unique serial number. Can be useful for debugging purposes.
Public method GetUsageCount
Gets the usage counter which gets increased each time an object is re-used from the pool.
Public method IsDeactivated
Checks if the object is deactivated and in the pool.


  Name Description
Public field doNotDestroyOnLoad
If enabled the object will not get destroyed if a new scene is loaded
Public field maxPoolSize
The maximum number of instances of this prefab to get stored in the pool.
Public field preloadCount
This number of instances will be preloaded to the pool if Preload(GameObject) is called.
Public field sendAwakeStartOnDestroyMessage
If enabled Awake(), Start(), and OnDestroy() messages are sent to the poolable object if the object is set active respectively inactive whenever Destroy(GameObject) or Instantiate(GameObject) is called.

This way it is simulated that the object really gets instantiated respectively destroyed.

Public field sendPoolableActivateDeactivateMessages
If enabled a OnPoolableObjectActivated and OnPoolableObjectDeactivated message is sent to the poolable instance if the object is activated respectively deactivated by the ObjectPoolController

See Also