Feel 5.9.1
The best way to improve your game's feel and make it extra juicy
Loading...
Searching...
No Matches
MoreMountains.Feedbacks.MMMiniObjectPooler Class Reference
Inheritance diagram for MoreMountains.Feedbacks.MMMiniObjectPooler:

Public Member Functions

virtual MMMiniObjectPool ExistingPool (string poolName)
 Looks for an existing pooler for the same object, returns it if found, returns null otherwise.
virtual void FillObjectPool ()
 Implement this method to fill the pool with objects.
virtual GameObject GetPooledGameObject ()
 Implement this method to return a gameobject.
virtual void DestroyObjectPool ()
 Destroys the object pool.

Static Public Member Functions

static void AddPool (MMMiniObjectPool pool)
 Adds a pooler to the static list if needed.
static void RemovePool (MMMiniObjectPool pool)
 Removes a pooler from the static list.
static string DetermineObjectPoolName (GameObject gameObjectToPool)
 Determines the name of the object pool.

Public Attributes

GameObject GameObjectToPool
 the game object we'll instantiate
int PoolSize = 20
 the number of objects we'll add to the pool
bool PoolCanExpand = true
 if true, the pool will automatically add objects to the itself if needed
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.
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

Protected Member Functions

virtual void Awake ()
 On awake we fill our object pool.
virtual void CreateWaitingPool ()
 Creates the waiting pool or tries to reuse one if there's already one available.
virtual GameObject AddOneObjectToThePool ()
 Adds one object of the specified type (in the inspector) to the pool.

Protected Attributes

GameObject _waitingPool = null
 this object is just used to group the pooled objects
MMMiniObjectPool _objectPool

Static Protected Attributes

const int _initialPoolsListCapacity = 5

Member Function Documentation

◆ AddOneObjectToThePool()

virtual GameObject MoreMountains.Feedbacks.MMMiniObjectPooler.AddOneObjectToThePool ( )
protectedvirtual

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

Returns
The one object to the pool.

◆ AddPool()

void MoreMountains.Feedbacks.MMMiniObjectPooler.AddPool ( MMMiniObjectPool pool)
static

Adds a pooler to the static list if needed.

Parameters
pool

◆ Awake()

virtual void MoreMountains.Feedbacks.MMMiniObjectPooler.Awake ( )
protectedvirtual

On awake we fill our object pool.

◆ CreateWaitingPool()

virtual void MoreMountains.Feedbacks.MMMiniObjectPooler.CreateWaitingPool ( )
protectedvirtual

Creates the waiting pool or tries to reuse one if there's already one available.

◆ DestroyObjectPool()

virtual void MoreMountains.Feedbacks.MMMiniObjectPooler.DestroyObjectPool ( )
virtual

Destroys the object pool.

◆ DetermineObjectPoolName()

string MoreMountains.Feedbacks.MMMiniObjectPooler.DetermineObjectPoolName ( GameObject gameObjectToPool)
static

Determines the name of the object pool.

Returns
The object pool name.

◆ ExistingPool()

virtual MMMiniObjectPool MoreMountains.Feedbacks.MMMiniObjectPooler.ExistingPool ( string poolName)
virtual

Looks for an existing pooler for the same object, returns it if found, returns null otherwise.

Parameters
objectToPool
Returns

◆ FillObjectPool()

virtual void MoreMountains.Feedbacks.MMMiniObjectPooler.FillObjectPool ( )
virtual

Implement this method to fill the pool with objects.

◆ GetPooledGameObject()

virtual GameObject MoreMountains.Feedbacks.MMMiniObjectPooler.GetPooledGameObject ( )
virtual

Implement this method to return a gameobject.

Returns
The pooled game object.

◆ RemovePool()

void MoreMountains.Feedbacks.MMMiniObjectPooler.RemovePool ( MMMiniObjectPool pool)
static

Removes a pooler from the static list.

Parameters
pool

Member Data Documentation

◆ _initialPoolsListCapacity

const int MoreMountains.Feedbacks.MMMiniObjectPooler._initialPoolsListCapacity = 5
staticprotected

◆ _objectPool

MMMiniObjectPool MoreMountains.Feedbacks.MMMiniObjectPooler._objectPool
protected

◆ _waitingPool

GameObject MoreMountains.Feedbacks.MMMiniObjectPooler._waitingPool = null
protected

this object is just used to group the pooled objects

◆ GameObjectToPool

GameObject MoreMountains.Feedbacks.MMMiniObjectPooler.GameObjectToPool

the game object we'll instantiate

◆ MutualizeWaitingPools

bool MoreMountains.Feedbacks.MMMiniObjectPooler.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.

◆ NestWaitingPool

bool MoreMountains.Feedbacks.MMMiniObjectPooler.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

◆ PoolCanExpand

bool MoreMountains.Feedbacks.MMMiniObjectPooler.PoolCanExpand = true

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

◆ PoolSize

int MoreMountains.Feedbacks.MMMiniObjectPooler.PoolSize = 20

the number of objects we'll add to the pool


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