UltimatePool.batchSpawn Method (GameObject, Int32)

Ultimate Pooling

UltimatePoolbatchSpawn Method (GameObject, Int32)
Spawn a number of instances of the specified prefab from the appropriate pool. If no pool exists, then one is automatically created for the prefab type. Batch spawning is quicker than multiple calls to spawn(GameObject) because the pool is cached on the first spawn.

Namespace: UltimatePooling
Assembly: Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0.0.0
Syntax
public static IEnumerable<GameObject> batchSpawn(
	GameObject prefab,
	int amount
)
UltimatePooling.UltimatePool.batchSpawn = function(prefab, amount);

Parameters

prefab
Type: GameObject
The prefab to spawn from
amount
Type: SystemInt32
The amount of instances to create from this prefab

Return Value

Type: IEnumerableGameObject
An enumeration of the spawned instances
See Also