Ultimate Pooling Scripting Reference
UltimatePoolbatchSpawn Method (Component, Object, Int32) |
Spawn a number of instances of the specified prefab and place the results in the specified array.
This overload allows the user to manager the array where the objects will be spawned to avoid garbage generation.
If no pool exists, then one is automatically created for the prefab type.
Batch spawning is quicker than multiple calls to spawn(Component) because the pool is cached on the first spawn.
If amount is specified then the value should be less than or equal to the length of the array otherwise an out of bounds exception may occur.
Namespace: UltimatePooling
Assembly: Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0.0.0

public static void batchSpawn( Component prefab, Object[] objects, int amount = -1 )
UltimatePooling.UltimatePool.batchSpawn = function(prefab, objects, amount);
Parameters
- prefab
- Type: Component
The prefab to spawn from - objects
- Type: Object
The array to store the spawned objects in - amount (Optional)
- Type: SystemInt32
The amount of objects to spawn. If the value is set to -1 then the array is filled
