Basic implementation of the IPoolContainer
More...
|
|
| PoolContainer () |
|
| PoolContainer (TPoolItem prefab) |
|
virtual void | Dispose () |
| TPoolItem | ReuseOrSpawnPoolItem (TPoolItem prefab, Transform parent, Predicate< TPoolItem > match=null) |
| | Pool or instantiate a new poolitem depending if any are free to use. Does not add the poolitem automatically to this container!
|
| TPoolItem | ReuseOrSpawnPoolItem (Transform parent, Predicate< TPoolItem > match=null) |
| | Pool or instantiate a new poolitem depending if any are free to use.
|
| bool | TryReusePoolItem (out TPoolItem poolItem, Predicate< TPoolItem > match=null) |
| | Gets a poolitem if any free are available.
|
| List< TPoolItem > | ReusePoolItems (Predicate< TPoolItem > match=null) |
| | Get as many pooled items that can be used as possible (does not instantiate new ones)
|
| virtual void | AddItem (TPoolItem item) |
| | Add a poolitem to this container (will automatically be removed when the item gets destroyed)
|
| virtual bool | RemoveItem (TPoolItem item) |
| | Remove the poolitem from this container.
|
| void | RemoveItem (int index) |
| | Remove the poolitem from this container by index.
|
|
|
virtual void | OnPoolItemDestroyed (IPoolItem poolItem) |
|
|
List< TPoolItem > | _poolList = new List<TPoolItem>() |
|
|
List< TPoolItem > | PoolList [get] |
|
TPoolItem | Prefab [get, set] |
| | The prefab to spawn if no poolable (free) item exists.
|
Basic implementation of the IPoolContainer
- Template Parameters
-
◆ AddItem()
| virtual void NikosAssets.Pooling.PoolContainer< TPoolItem >.AddItem |
( |
TPoolItem | item | ) |
|
|
virtual |
Add a poolitem to this container (will automatically be removed when the item gets destroyed)
- Parameters
-
◆ RemoveItem() [1/2]
| void NikosAssets.Pooling.PoolContainer< TPoolItem >.RemoveItem |
( |
int | index | ) |
|
Remove the poolitem from this container by index.
- Parameters
-
◆ RemoveItem() [2/2]
| virtual bool NikosAssets.Pooling.PoolContainer< TPoolItem >.RemoveItem |
( |
TPoolItem | item | ) |
|
|
virtual |
Remove the poolitem from this container.
- Parameters
-
- Returns
◆ ReuseOrSpawnPoolItem() [1/2]
| TPoolItem NikosAssets.Pooling.PoolContainer< TPoolItem >.ReuseOrSpawnPoolItem |
( |
TPoolItem | prefab, |
|
|
Transform | parent, |
|
|
Predicate< TPoolItem > | match = null ) |
Pool or instantiate a new poolitem depending if any are free to use. Does not add the poolitem automatically to this container!
- Parameters
-
| prefab | |
| parent | |
| match | Optional function to check for more conditions on poolable items |
- Returns
- A poolitem where the PoolingReset() function has already been called on a pooled one only
◆ ReuseOrSpawnPoolItem() [2/2]
| TPoolItem NikosAssets.Pooling.PoolContainer< TPoolItem >.ReuseOrSpawnPoolItem |
( |
Transform | parent, |
|
|
Predicate< TPoolItem > | match = null ) |
Pool or instantiate a new poolitem depending if any are free to use.
- Parameters
-
| parent | |
| match | Optional function to check for more conditions on poolable items |
- Returns
- A poolitem where the PoolingReset() function has already been called on a pooled one only
◆ ReusePoolItems()
| List< TPoolItem > NikosAssets.Pooling.PoolContainer< TPoolItem >.ReusePoolItems |
( |
Predicate< TPoolItem > | match = null | ) |
|
Get as many pooled items that can be used as possible (does not instantiate new ones)
- Parameters
-
- Returns
◆ TryReusePoolItem()
| bool NikosAssets.Pooling.PoolContainer< TPoolItem >.TryReusePoolItem |
( |
out TPoolItem | poolItem, |
|
|
Predicate< TPoolItem > | match = null ) |
Gets a poolitem if any free are available.
- Parameters
-
| poolItem | null if no poolable item has been found |
| match | Optional function to check for more conditions on poolable items |
- Returns
- true if a poolable item has been found and pooled out
The documentation for this class was generated from the following file: