Feel 5.9.1
The best way to improve your game's feel and make it extra juicy
Loading...
Searching...
No Matches
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.
override GameObject GetPooledGameObject ()
 This method returns one inactive object from the pool.
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.
virtual void DestroyObjectPool ()
 Destroys 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
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.
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
bool NestUnderThis = false
 if this is true, the waiting pool will be nested under this object

Protected Member Functions

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

Properties

virtual List< MMSimpleObjectPoolerOwner [get, set]

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.
static void RemovePool (MMObjectPool pool)
 Removes a pooler from the static list.
Static Public Attributes inherited from MoreMountains.Tools.MMObjectPooler
static MMObjectPooler Instance
 singleton pattern
static List< MMObjectPool_pools = new List<MMObjectPool>(_initialPoolsListCapacity)
Static Protected Member Functions inherited from MoreMountains.Tools.MMObjectPooler
static void InitializeStatics ()
Protected Attributes inherited from MoreMountains.Tools.MMObjectPooler
GameObject _waitingPool = null
 this object is just used to group the pooled objects
MMObjectPool _objectPool
bool _onSceneLoadedRegistered = false
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

◆ 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

Property Documentation

◆ Owner

virtual List<MMSimpleObjectPooler> MoreMountains.Tools.MMSimpleObjectPooler.Owner
getset

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