This class allows you to have a pool of various objects to pool from.
More...
Inherits MoreMountains.Tools.MMObjectPooler.
|
override string | DetermineObjectPoolName () |
| Determines the name of the object pool. More...
|
|
virtual GameObject | AddOneObjectToThePool (GameObject typeOfObject) |
| Adds one object of the specified type to the object pool. More...
|
|
virtual GameObject | GetPooledGameObjectOriginalOrder () |
| Tries to find a gameobject in the pool according to the order the list has been setup in (one of each, no matter how big their respective pool sizes) More...
|
|
virtual GameObject | GetPooledGameObjectOriginalOrderSequential () |
| Tries to find a gameobject in the pool according to the order the list has been setup in (one of each, no matter how big their respective pool sizes) More...
|
|
virtual void | OrderSequentialResetCounter (MMMultipleObjectPoolerObject searchedObject) |
|
virtual GameObject | GetPooledGameObjectPoolSizeBased () |
| Randomly choses one object from the pool, based on its pool size probability (the larger the pool size, the higher the chances it'll get picked) More...
|
|
virtual GameObject | GetPooledGameObjectRandomBetweenObjects () |
| Gets one object from the pool, at random, but ignoring its pool size, each object has equal chances to get picked More...
|
|
virtual GameObject | FindInactiveObject (string searchedName, List< GameObject > list) |
| Finds an inactive object in the pool based on its name. More...
|
|
virtual GameObject | FindAnyInactiveObject (List< GameObject > list) |
|
virtual GameObject | FindObject (string searchedName, List< GameObject > list) |
| Finds an object in the pool based on its name, active or inactive Returns null if there's no object by that name in the pool More...
|
|
virtual MMMultipleObjectPoolerObject | GetPoolObject (GameObject testedObject) |
| Returns (if it exists) the MultipleObjectPoolerObject from the original Pool based on a GameObject. More...
|
|
virtual bool | PoolObjectEnabled (GameObject testedObject) |
|
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...
|
|
virtual void | OnEnable () |
| On enable we register to the scene loaded hook More...
|
|
This class allows you to have a pool of various objects to pool from.
◆ AddOneObjectToThePool()
virtual GameObject MoreMountains.Tools.MMMultipleObjectPooler.AddOneObjectToThePool |
( |
GameObject |
typeOfObject | ) |
|
|
protectedvirtual |
Adds one object of the specified type to the object pool.
- Returns
- The object that just got added.
- Parameters
-
typeOfObject | The type of object to add to the pool. |
◆ DetermineObjectPoolName()
override string MoreMountains.Tools.MMMultipleObjectPooler.DetermineObjectPoolName |
( |
| ) |
|
|
protectedvirtual |
◆ EnableObjects()
virtual void MoreMountains.Tools.MMMultipleObjectPooler.EnableObjects |
( |
string |
name, |
|
|
bool |
newStatus |
|
) |
| |
|
virtual |
◆ FillObjectPool()
override void MoreMountains.Tools.MMMultipleObjectPooler.FillObjectPool |
( |
| ) |
|
|
virtual |
◆ FindAnyInactiveObject()
virtual GameObject MoreMountains.Tools.MMMultipleObjectPooler.FindAnyInactiveObject |
( |
List< GameObject > |
list | ) |
|
|
protectedvirtual |
◆ FindInactiveObject()
virtual GameObject MoreMountains.Tools.MMMultipleObjectPooler.FindInactiveObject |
( |
string |
searchedName, |
|
|
List< GameObject > |
list |
|
) |
| |
|
protectedvirtual |
Finds an inactive object in the pool based on its name.
Returns null if no inactive object by that name were found in the pool
- Returns
- The inactive object.
- Parameters
-
searchedName | Searched name. |
◆ FindObject()
virtual GameObject MoreMountains.Tools.MMMultipleObjectPooler.FindObject |
( |
string |
searchedName, |
|
|
List< GameObject > |
list |
|
) |
| |
|
protectedvirtual |
Finds an object in the pool based on its name, active or inactive Returns null if there's no object by that name in the pool
- Returns
- The object.
- Parameters
-
searchedName | Searched name. |
◆ GetPooledGameObject()
override GameObject MoreMountains.Tools.MMMultipleObjectPooler.GetPooledGameObject |
( |
| ) |
|
|
virtual |
◆ GetPooledGameObjectOfType()
virtual GameObject MoreMountains.Tools.MMMultipleObjectPooler.GetPooledGameObjectOfType |
( |
string |
searchedName | ) |
|
|
virtual |
Gets an object of the specified name from the pool Note that the whole point of this multiple object pooler is to abstract the various pools and handle the picking based on the selected mode.
If you plan on just picking from different pools yourself, consider simply having multiple single object poolers.
- Returns
- The pooled game object of type.
- Parameters
-
◆ GetPooledGameObjectOriginalOrder()
virtual GameObject MoreMountains.Tools.MMMultipleObjectPooler.GetPooledGameObjectOriginalOrder |
( |
| ) |
|
|
protectedvirtual |
Tries to find a gameobject in the pool according to the order the list has been setup in (one of each, no matter how big their respective pool sizes)
- Returns
- The pooled game object original order.
◆ GetPooledGameObjectOriginalOrderSequential()
virtual GameObject MoreMountains.Tools.MMMultipleObjectPooler.GetPooledGameObjectOriginalOrderSequential |
( |
| ) |
|
|
protectedvirtual |
Tries to find a gameobject in the pool according to the order the list has been setup in (one of each, no matter how big their respective pool sizes)
- Returns
- The pooled game object original order.
◆ GetPooledGameObjectPoolSizeBased()
virtual GameObject MoreMountains.Tools.MMMultipleObjectPooler.GetPooledGameObjectPoolSizeBased |
( |
| ) |
|
|
protectedvirtual |
Randomly choses one object from the pool, based on its pool size probability (the larger the pool size, the higher the chances it'll get picked)
- Returns
- The pooled game object pool size based.
◆ GetPooledGameObjectRandomBetweenObjects()
virtual GameObject MoreMountains.Tools.MMMultipleObjectPooler.GetPooledGameObjectRandomBetweenObjects |
( |
| ) |
|
|
protectedvirtual |
Gets one object from the pool, at random, but ignoring its pool size, each object has equal chances to get picked
- Returns
- The pooled game object random between objects.
◆ GetPooledGamObjectAtIndex()
virtual GameObject MoreMountains.Tools.MMMultipleObjectPooler.GetPooledGamObjectAtIndex |
( |
int |
index | ) |
|
|
virtual |
Gets an object of the type at the specified index in the Pool.
Note that the whole point of this multiple object pooler is to abstract the various pools and handle the picking based on the selected mode. If you plan on just picking from different pools yourself, consider simply having multiple single object poolers.
- Parameters
-
◆ GetPoolObject()
Returns (if it exists) the MultipleObjectPoolerObject from the original Pool based on a GameObject.
Note that this is name based.
- Returns
- The pool object.
- Parameters
-
testedObject | Tested object. |
◆ OrderSequentialResetCounter()
◆ PoolObjectEnabled()
virtual bool MoreMountains.Tools.MMMultipleObjectPooler.PoolObjectEnabled |
( |
GameObject |
testedObject | ) |
|
|
protectedvirtual |
◆ ResetCurrentIndex()
virtual void MoreMountains.Tools.MMMultipleObjectPooler.ResetCurrentIndex |
( |
| ) |
|
|
virtual |
◆ _currentCount
int MoreMountains.Tools.MMMultipleObjectPooler._currentCount = 0 |
|
protected |
◆ _currentIndex
int MoreMountains.Tools.MMMultipleObjectPooler._currentIndex = 0 |
|
protected |
◆ _currentIndexCounter
int MoreMountains.Tools.MMMultipleObjectPooler._currentIndexCounter = 0 |
|
protected |
◆ _lastPooledObject
GameObject MoreMountains.Tools.MMMultipleObjectPooler._lastPooledObject |
|
protected |
◆ _tempSearchedName
string MoreMountains.Tools.MMMultipleObjectPooler._tempSearchedName |
|
protected |
◆ CanPoolSameObjectTwice
bool MoreMountains.Tools.MMMultipleObjectPooler.CanPoolSameObjectTwice =true |
whether or not the same object can be pooled twice in a row. If you set CanPoolSameObjectTwice to false, the Pooler will try to prevent the same object from being pooled twice to avoid repetition. This will only affect random pooling methods, not ordered pooling.
◆ MutualizedPoolName
string MoreMountains.Tools.MMMultipleObjectPooler.MutualizedPoolName = "" |
a unique name that should match on all MMMultipleObjectPoolers you want to use together
◆ Pool
the list of objects to pool
◆ PoolingMethod
the chosen pooling method
◆ Owner
The documentation for this class was generated from the following file: