A generic object pool for reusing objects.
Constructor
Variables
Methods
dynamicclean(object:T):Void
Dynamic function.
Cleans up an object before returning it to the pool.
Parameters:
object | The object to clean up. |
|---|
get():T
Creates a new object and adds it to the pool, or returns an existing inactive object from the pool.
Returns:
The object retrieved from the pool, or null if the pool is full and no new objects can be created.