![]() |
Corgi Engine v9.3
|
A simple object pool outputting a single type of objects More...
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... | |
![]() | |
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... | |
![]() | |
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... | |
![]() | |
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... | |
Properties | |
virtual List< MMSimpleObjectPooler > | Owner [getset] |
Additional Inherited Members | |
![]() | |
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 MMObjectPooler | Instance |
singleton pattern More... | |
static List< MMObjectPool > | _pools = new List<MMObjectPool>(_initialPoolsListCapacity) |
![]() | |
static void | InitializeStatics () |
![]() | |
GameObject | _waitingPool = null |
this object is just used to group the pooled objects More... | |
MMObjectPool | _objectPool |
bool | _onSceneLoadedRegistered = false |
![]() | |
const int | _initialPoolsListCapacity = 5 |
A simple object pool outputting a single type of objects
|
protectedvirtual |
Adds one object of the specified type (in the inspector) to the pool.
|
protectedvirtual |
Determines the name of the object pool.
Reimplemented from MoreMountains.Tools.MMObjectPooler.
|
virtual |
Fills the object pool with the gameobject type you've specified in the inspector
Reimplemented from MoreMountains.Tools.MMObjectPooler.
|
virtual |
This method returns one inactive object from the pool
Reimplemented from MoreMountains.Tools.MMObjectPooler.
GameObject MoreMountains.Tools.MMSimpleObjectPooler.GameObjectToPool |
the game object we'll instantiate
bool MoreMountains.Tools.MMSimpleObjectPooler.PoolCanExpand = true |
if true, the pool will automatically add objects to the itself if needed
int MoreMountains.Tools.MMSimpleObjectPooler.PoolSize = 20 |
the number of objects we'll add to the pool
|
getset |