JUtils
A unity utilities library
|
A simple implementation for an object pool More...
Public Member Functions | |
PoolItem | SpawnItem () |
Spawn a pooled item More... | |
PoolItem | SpawnItem (Vector3 localPosition) |
Spawn a pooled item More... | |
PoolItem | SpawnItem (Vector3 localPosition, Transform parent) |
Spawn a pooled item More... | |
PoolItem | SpawnItem (Transform parent) |
Spawn a pooled item More... | |
PoolItem | SpawnItem (Vector3 localPosition, Quaternion localRotation, Transform parent=null) |
Spawn a pooled item More... | |
bool | TryGetItem (out PoolItem item) |
Get a pooled item, returns false if the pool can't auto expand and if there are no items left More... | |
int | InstantiateNewItems (int amount=-1) |
Request X amount of items to be made More... | |
void | SetTemplate (PoolItem newTemplate) |
Change the template of this object pool More... | |
Properties | |
PoolItem | template [get] |
IEnumerable< PoolItem > | activePoolItems [get] |
IEnumerable< PoolItem > | freePoolItems [get] |
A simple implementation for an object pool
Disabling this component may result in erroneous behaviour
|
inline |
Request X amount of items to be made
|
inline |
Change the template of this object pool
Template can only change when no object has been created
|
inline |
Spawn a pooled item
|
inline |
Spawn a pooled item
References JUtils.ObjectPool.SpawnItem().
|
inline |
Spawn a pooled item
References JUtils.ObjectPool.SpawnItem().
|
inline |
Spawn a pooled item
|
inline |
Spawn a pooled item
References JUtils.ObjectPool.SpawnItem().
|
inline |
Get a pooled item, returns false if the pool can't auto expand and if there are no items left
|
get |
|
get |
|
get |