Pooling is where you recycle unused GameObjects instead of constantly using Instantiate and Destroy.
To use it, all you have to do is replace your Instantiate calls with Lean.LeanPool.Spawn calls, and your Destroy calls with Lean.LeanPool.Despawn calls, and it will work like magic.
Lean Pool also comes with more advanced settings, such as the ability
to preload a certain amount of prefab clones, the ability to specify a
maximum amount of prefab clones that can be spawned, and the method used
to notify prefab clones about their pooling.
Lean Pool is designed to work with both GameObjects and Components,
and allows you to easily add support for custom pool handling, e.g.
resetting a Rigidbody's velocity (this script comes included).
脚本下载:
|
|
|
|
|
|