Pro Pooling
ProPooling.Pools Class Reference

Component for adding additional Pools to the Global Pools based on the lifecycle of this component. More...

Inheritance diagram for ProPooling.Pools:
ProPooling.PoolsBase

Public Member Functions

void AddPoolsToGlobalPools ()
 Add the pools to the pool manager More...
 
void RemovePoolsFromGlobalPools ()
 Remove the pools from the pool manager More...
 
- Public Member Functions inherited from ProPooling.PoolsBase
 PoolsBase ()
 Constructor needed for unit testing. More...
 
void InitialisePools ()
 Initialise all pools - called by singleton in Awake More...
 
Pool GetPool (GameObject prefab)
 Get a pool for the given prefab, optionally creating it if needed based upon the global settings More...
 
Pool GetPool (GameObject prefab, bool autoCreate)
 Get a pool for the given prefab, optionally creating it if needed More...
 
Pool GetPool (string name)
 Get a pool for the prefab with the specified name More...
 
bool ContainsPool (string name)
 Whether the named pool already exists More...
 
bool ContainsPool (GameObject prefab)
 Whether a pool for the specified GameObject already exists More...
 
Pool CreatePool (GameObject prefab, Transform inactiveParent=null)
 Create a pool for the given prefab with default parameters. If an existing pool is found for this prefab then that is returned instead. More...
 
Pool CreatePool (GameObject prefab, int initialSize, Pool.SizeExceededModeType limitExceededMode, bool hasMaximumSize, int maximumSize, bool createIfMaximumExceeded, Transform inactiveParent=null)
 Create a pool for the given prefab with the specified parameters. If an existing pool is found for this prefab then that is returned instead. More...
 
Pool AddPool (Pool pool)
 Add a pool to management. More...
 
void RemovePool (Pool pool)
 Remove the specified pool from management. More...
 
void ClearAndRemovePool (Pool pool)
 Clear the pool and remove it from management. Note that if there are still spawned items then these will not be destroyed by this call. More...
 
GameObject Spawn (string poolName, Transform parent=null)
 Spawn a gameobject from the named pool. More...
 
GameObject Spawn (string poolName, Vector3 position, Quaternion rotation, Transform parent=null)
 Spawn a gameobject from the named pool. More...
 
PoolItem SpawnPoolItem (string poolName, Transform parent=null)
 Spawn a PoolItem reference from the named pool More...
 
PoolItem SpawnPoolItem (string poolName, Vector3 position, Quaternion rotation, Transform parent=null)
 Spawn a PoolItem reference from the named pool More...
 
GameObject Spawn (GameObject gameObject, Transform parent=null)
 Spawn a gameobject from the pool of the specified type. More...
 
GameObject Spawn (GameObject gameObject, Vector3 position, Quaternion rotation, Transform parent=null)
 Spawn a gameobject from the pool of the spefified type. More...
 
PoolItem SpawnPoolItem (GameObject gameObject, Transform parent=null)
 Spawn a PoolItem reference from the pool of the spefified type. More...
 
PoolItem SpawnPoolItem (Pool pool, GameObject gameObject, Transform parent=null)
 Spawn a PoolItem reference from the pool of the spefified type. More...
 
PoolItem SpawnPoolItem (GameObject gameObject, Vector3 position, Quaternion rotation, Transform parent=null)
 Spawn a PoolItem reference from the pool of the spefified type. More...
 
PoolItem SpawnPoolItem (Pool pool, GameObject gameObject, Vector3 position, Quaternion rotation, Transform parent=null)
 Spawn a PoolItem reference from the pool of the specified type. More...
 
bool Despawn (PoolItem poolItem)
 Despawn an item back to a pool managed by GlobalPools. More...
 
bool Despawn (GameObject gameObject)
 Despawn an item back to a pool managed by GlobalPools. More...
 

Properties

bool AddToGlobalPools [get, set]
 Whether to add pools to the GlobalPools component More...
 
- Properties inherited from ProPooling.PoolsBase
bool AutomaticallyAddRuntimePools [get, set]
 Whether to automatically add pools for requested items that do not exist. More...
 
Pool DefaultPoolSettings [get, set]
 Default settings for new Pools and Pools that are automatically created. More...
 
List< PoolPools [get, set]
 A list of pools that should be preallocated. More...
 
bool IsInitialised [get, set]
 Whether the poolmanager has been initialised. More...
 

Additional Inherited Members

- Public Attributes inherited from ProPooling.PoolsBase
const string MessageAssertIsActive = "Pro Pooling: Global Pools is not active. Please check it is added to you scene and if needed increate it's script execution order priority."
 

Detailed Description

Component for adding additional Pools to the Global Pools based on the lifecycle of this component.

Pools will be added / removed to the Global Pools when this component is enabled / disabled so you may use this for adding any per scene pools that you need. Pooled instances will be added as children of the containing GameObject and so will be destroyed the GameObject to which this component is added is destroyed.

Member Function Documentation

◆ AddPoolsToGlobalPools()

void ProPooling.Pools.AddPoolsToGlobalPools ( )

Add the pools to the pool manager

◆ RemovePoolsFromGlobalPools()

void ProPooling.Pools.RemovePoolsFromGlobalPools ( )

Remove the pools from the pool manager

Property Documentation

◆ AddToGlobalPools

bool ProPooling.Pools.AddToGlobalPools
getset

Whether to add pools to the GlobalPools component


The documentation for this class was generated from the following file: