Click or drag to resize
ObjectXGetFromPoolT Method
Gets the next suitable inactive object in the pool. Instantiates a new one if none is available.

Namespace: Candlelight
Assembly: Assembly-CSharp-firstpass (in Assembly-CSharp-firstpass.dll) Version: 0.0.0.0
Syntax
C#
public static T GetFromPool<T>(
	List<T> pool,
	T prefab,
	Transform parent = null,
	Predicate<T> isElementSuitable = null
)
where T : Component

Parameters

pool
Type: System.Collections.GenericListT
Pool.
prefab
Type: T
Prefab to instantiate if no instance is available in pool. If , then an empty GameObject with the component will be created and used.
parent (Optional)
Type: Transform
Optional object that should become the parent of the retrieved instance. Set this value in particular for e.g., UI prefabs.
isElementSuitable (Optional)
Type: SystemPredicateT
Optional predicate to determine if an inactive item in the pool is suitable for use.

Type Parameters

T
The type of object in the pool.

Return Value

Type: T
The next suitable inactive object from the pool.
See Also