ObjectPool.

CreatePrefabPool(GameObject, int, bool) Method

Summary

Creates an Weaver.ObjectPool`1 that creates new items by instantiating a specified UnityEngine.GameObject. 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
ObjectPool

Syntax

public static ObjectPool<GameObject> CreatePrefabPool(GameObject original, int preAllocate = 0, bool releaseOnSceneUnload = true)

Parameters

Name Type Description
original GameObject
preAllocate int
releaseOnSceneUnload bool

Return Value

Type Description
ObjectPool<GameObject>