Constructor MonoBehaviourPool
- Namespace
- Gamelogic.Extensions
- Assembly
- Gamelogic.Extensions.dll
MonoBehaviourPool(T, GameObject, int, Action<T>, Action<T>)
Initializes a new instance of the MonoBehaviourPool<T> class.
public MonoBehaviourPool(T prefab, GameObject parent, int initialCount, Action<T> wakeUp, Action<T> setToSleep)
Parameters
prefab
TThe prefab used to instantiate objects from.
parent
GameObjectThe parent object to which the pool objects will be attached.
initialCount
intThe initial count of objects to create.
wakeUp
Action<T>A function called on an object when it is woken up.
setToSleep
Action<T>A function called on objects when they are put to sleep.