UltimatePool.batchSpawn(T) Method (Component, Int32)

Ultimate Pooling

UltimatePoolbatchSpawnT Method (Component, Int32)
Spawn a number of instances of the specified component 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 spawnT(Component) 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<T> batchSpawn<T>(
	Component prefab,
	int amount
)
where T : Object
JavaScript does not support generic types or methods.

Parameters

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

Type Parameters

T
The type of object to return the instances as

Return Value

Type: IEnumerableT
An enumeration of the spawned instances
See Also