Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ParticlePool

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor

  • 使用构造函数来创建一个指定对象类型的对象池,您可以传递一个回调函数,用于处理对象回收时的清理逻辑。

    method

    constructor

    Parameters

    • cleanup: CleanUpFunction<Particle>
    • size: number

      initializes the length of the array

    Returns ParticlePool

  • 使用构造函数来创建一个指定对象类型的对象池,您可以传递一个回调函数,用于处理对象回收时的清理逻辑。

    method

    constructor

    Parameters

    • size: number

      initializes the length of the array

    Returns ParticlePool

Properties

count

count: number

The current number of available objects, the default is 0, it will gradually increase with the recycle of the object, the maximum will not exceed the size specified when the constructor is called.

default

0

Methods

get

  • _get(): null | T

get

put

resize

  • resize(length: number): void

Generated using TypeDoc