Pro Pooling
ProPooling.PoolItem Class Reference

A meta data class associated with all pooled instance with shortcuts to key data and lifecycle functionality. More...

Public Member Functions

virtual void OnSetup ()
 Called when this item is setup More...
 
virtual void OnSpawn ()
 Called when this item is spawned from the pool More...
 
virtual void OnDespawn ()
 Called when this item is despawned back to the pool More...
 
virtual void OnDestroy ()
 Called just before this item is destroyed. More...
 
virtual void DespawnSelf ()
 Call to despawn this item back to its pool More...
 

Properties

Pool Pool [get, set]
 A reference to the Pool that contains this item for quick and easy access. More...
 
GameObject OriginalPrefab [get, set]
 The original prefab that was used for creating this item. Can be used to access initial values. More...
 
GameObject GameObject [get, set]
 The instantiated gameobject for this pool item. More...
 
bool IsFromPool [get, set]
 Whether this item is actually from the pool as opposed to created ad-hoc due to limits being breached. More...
 

Detailed Description

A meta data class associated with all pooled instance with shortcuts to key data and lifecycle functionality.

This class contains amongst other things a reference to the containing pool, the original prefab and lifecycle callbacks.

You can override this class and use it to store and parse per pooled item information for your own purposed. Be sure to consider whether to call the base class methods if you are overriding anything. See PoolGeneric for information about using subclassed versions of this class.

Member Function Documentation

◆ DespawnSelf()

virtual void ProPooling.PoolItem.DespawnSelf ( )
virtual

Call to despawn this item back to its pool

◆ OnDespawn()

virtual void ProPooling.PoolItem.OnDespawn ( )
virtual

Called when this item is despawned back to the pool

◆ OnDestroy()

virtual void ProPooling.PoolItem.OnDestroy ( )
virtual

Called just before this item is destroyed.

◆ OnSetup()

virtual void ProPooling.PoolItem.OnSetup ( )
virtual

Called when this item is setup

◆ OnSpawn()

virtual void ProPooling.PoolItem.OnSpawn ( )
virtual

Called when this item is spawned from the pool

Property Documentation

◆ GameObject

GameObject ProPooling.PoolItem.GameObject
getset

The instantiated gameobject for this pool item.

◆ IsFromPool

bool ProPooling.PoolItem.IsFromPool
getset

Whether this item is actually from the pool as opposed to created ad-hoc due to limits being breached.

◆ OriginalPrefab

GameObject ProPooling.PoolItem.OriginalPrefab
getset

The original prefab that was used for creating this item. Can be used to access initial values.

◆ Pool

Pool ProPooling.PoolItem.Pool
getset

A reference to the Pool that contains this item for quick and easy access.


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