Highroad Engine v1.3
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
MoreMountains.Tools.MMSimpleObjectPooler Class Reference

A simple object pool outputting a single type of objects More...

Inheritance diagram for MoreMountains.Tools.MMSimpleObjectPooler:
MoreMountains.Tools.MMObjectPooler

Public Member Functions

override void FillObjectPool ()
 Fills the object pool with the gameobject type you've specified in the inspector More...
 
override GameObject GetPooledGameObject ()
 This method returns one inactive object from the pool More...
 
- Public Member Functions inherited from MoreMountains.Tools.MMObjectPooler
virtual MMObjectPool ExistingPool (string poolName)
 Looks for an existing pooler for the same object, returns it if found, returns null otherwise More...
 
virtual void DestroyObjectPool ()
 Destroys the object pool More...
 

Public Attributes

GameObject GameObjectToPool
 the game object we'll instantiate More...
 
int PoolSize = 20
 the number of objects we'll add to the pool More...
 
bool PoolCanExpand = true
 if true, the pool will automatically add objects to the itself if needed More...
 
- Public Attributes inherited from MoreMountains.Tools.MMObjectPooler
bool MutualizeWaitingPools = false
 if this is true, the pool will try not to create a new waiting pool if it finds one with the same name. More...
 
bool NestWaitingPool = true
 if this is true, all waiting and active objects will be regrouped under an empty game object. Otherwise they'll just be at top level in the hierarchy More...
 
bool NestUnderThis = false
 if this is true, the waiting pool will be nested under this object More...
 

Protected Member Functions

override string DetermineObjectPoolName ()
 Determines the name of the object pool. More...
 
virtual GameObject AddOneObjectToThePool ()
 Adds one object of the specified type (in the inspector) to the pool. More...
 
- Protected Member Functions inherited from MoreMountains.Tools.MMObjectPooler
virtual void Awake ()
 On awake we fill our object pool More...
 
virtual bool CreateWaitingPool ()
 Creates the waiting pool or tries to reuse one if there's already one available More...
 
virtual void ApplyNesting ()
 If needed, nests the waiting pool under this object More...
 

Protected Attributes

List< GameObject > _pooledGameObjects
 the actual object pool More...
 
- Protected Attributes inherited from MoreMountains.Tools.MMObjectPooler
GameObject _waitingPool = null
 this object is just used to group the pooled objects More...
 
MMObjectPool _objectPool
 

Additional Inherited Members

- Static Public Member Functions inherited from MoreMountains.Tools.MMObjectPooler
static void AddPool (MMObjectPool pool)
 Adds a pooler to the static list if needed More...
 
static void RemovePool (MMObjectPool pool)
 Removes a pooler from the static list More...
 
- Static Public Attributes inherited from MoreMountains.Tools.MMObjectPooler
static MMObjectPooler Instance
 singleton pattern More...
 
static List< MMObjectPool_pools = new List<MMObjectPool>(_initialPoolsListCapacity)
 
- Static Protected Attributes inherited from MoreMountains.Tools.MMObjectPooler
const int _initialPoolsListCapacity = 5
 

Detailed Description

A simple object pool outputting a single type of objects

Member Function Documentation

◆ AddOneObjectToThePool()

virtual GameObject MoreMountains.Tools.MMSimpleObjectPooler.AddOneObjectToThePool ( )
protectedvirtual

Adds one object of the specified type (in the inspector) to the pool.

Returns
The one object to the pool.

◆ DetermineObjectPoolName()

override string MoreMountains.Tools.MMSimpleObjectPooler.DetermineObjectPoolName ( )
protectedvirtual

Determines the name of the object pool.

Returns
The object pool name.

Reimplemented from MoreMountains.Tools.MMObjectPooler.

◆ FillObjectPool()

override void MoreMountains.Tools.MMSimpleObjectPooler.FillObjectPool ( )
virtual

Fills the object pool with the gameobject type you've specified in the inspector

Reimplemented from MoreMountains.Tools.MMObjectPooler.

◆ GetPooledGameObject()

override GameObject MoreMountains.Tools.MMSimpleObjectPooler.GetPooledGameObject ( )
virtual

This method returns one inactive object from the pool

Returns
The pooled game object.

Reimplemented from MoreMountains.Tools.MMObjectPooler.

Member Data Documentation

◆ _pooledGameObjects

List<GameObject> MoreMountains.Tools.MMSimpleObjectPooler._pooledGameObjects
protected

the actual object pool

◆ GameObjectToPool

GameObject MoreMountains.Tools.MMSimpleObjectPooler.GameObjectToPool

the game object we'll instantiate

◆ PoolCanExpand

bool MoreMountains.Tools.MMSimpleObjectPooler.PoolCanExpand = true

if true, the pool will automatically add objects to the itself if needed

◆ PoolSize

int MoreMountains.Tools.MMSimpleObjectPooler.PoolSize = 20

the number of objects we'll add to the pool


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