UltimatePool.batchSpawn Method (String, Object[], Int32)

Ultimate Pooling

UltimatePoolbatchSpawn Method (String, Object, Int32)
Spawn a number of instances of a prefab with the specified name from the appropriate pool. This overload allows the user to manage the array where the objects will be spawned to avoid garbage generation. This method will only succeed if the pool has been created before hand. Batch spawning is quicker than multiple calls to spawn(String) 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
Syntax
public static void batchSpawn(
	string prefabName,
	Object[] objects,
	int amount = -1
)
UltimatePooling.UltimatePool.batchSpawn = function(prefabName, objects, amount);

Parameters

prefabName
Type: SystemString
The name of 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
See Also