addBuffer()

初始化一個將用於存儲指標值的對象

Return value

新緩衝區

Description

在構造函數中使用。 存儲在該類的一個屬性中

Example

// 初始化3個對象 MNKBufferOne, MNKBufferTwo, MNKBufferThree 並在class屬性中分配它們 buffers
this.buffers = {
      MNKBufferOne : this.addBuffer(),
      MNKBufferTwo : this.addBuffer(),
      MNKBufferThree:this.addBuffer(),
};
// 在方法中 onInit 或者 onUpdate 我們通過解構得到這些對象
const {MNKBufferOne, MNKBufferTwoб MNKBufferThree} = this.buffers;