PooledList.

CreateComponentPool<T>(T, int, bool) Method

Summary

Creates a Weaver.PooledList`1 that creates new items by instantiating a specified UnityEngine.Component. The objects will not be destroyed by scene loading.

In the Unity Editor the instantiated objects will be grouped under a common parent to keep the hierarchy view tidy, but this step is skipped in runtime builds for efficiency.
Assembly
Weaver.dll
Namespace
Weaver
Containing Type
PooledList

Syntax

public static PooledList<T> CreateComponentPool<T>(T original, int preAllocate = 0, bool releaseOnSceneLoad = true) 
    where T : Component

Type Parameters

Name Description
T

Parameters

Name Type Description
original T
preAllocate int
releaseOnSceneLoad bool

Return Value

Type Description
PooledList<T>