Members
(constant) POOL_BEHAVIOR_ON_OVERFLOW :Number
Enum for behavior of ObjectPool when the number of currently spawned objects exceeds the pool size
Type:
- Number
Properties:
| Name | Type | Description |
|---|---|---|
RETURN_NULL |
Number | The value for if the pool should just return null and not spawn any new objects |
RETURN_NEW_AND_NOT_POOL |
Number | The value for if the pool should spawn an object but not pool it |
EXPAND_POOL |
Number | The value for if a pool should just expand its size to fit the new object being spawned |
- Source:
(constant) POOL_SELECTION :Number
Enum for how objects are taken from the pool
Type:
- Number
Properties:
| Name | Type | Description |
|---|---|---|
FIRST |
Number | Select the first unallocated pool object |
RANDOM |
Number | Select a random unallocated pool object |
- Source:
Methods
flatten(arrays, removeNullsAndUndefinedsopt)
Flattens an n-dimensional array
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
arrays |
Array | array to flatten | ||
removeNullsAndUndefineds |
Boolean |
<optional> |
true | whether or not to remove null and undefined values when flattening the array. Defaults to true. |
Returns:
flattened array
Type Definitions
destroyFuncCallback(obj)
Destructor for a GameObject
Parameters:
| Name | Type | Description |
|---|---|---|
obj |
GameObject | object to destroy |
- Source:
generatorCallback()
Returns a new GameObject
- Source:
Returns:
GameObject
PooledInstance
Type:
- Object
Properties:
| Name | Type | Description |
|---|---|---|
object |
GameObject | instance of object |
isBeingUsed |
Boolean | whether or not the pooled instance is currently allocated |
cRef |
Array | pointer to list of spawned objects in ObjectPool |
object.pooledInstance |
ObjectPool | pointer to ObjectPool that contains object |
- Source:
resetFuncCallback(obj)
Resets the properties of a GameObject to what they would be if it was a newly created object
Parameters:
| Name | Type | Description |
|---|---|---|
obj |
GameObject | object to reset |
- Source: