UNPKG

laya-coreui-es

Version:

laya核心库、ui库es版本,剔除了媒体、TTF等功能。基于 LayaAir-release_2.12.0 修改

21 lines (20 loc) 689 B
import { IndexBuffer2D } from "../../../utils/IndexBuffer2D"; import { VertexBuffer2D } from "../../../utils/VertexBuffer2D"; import { LayaGL } from "../../../../layagl/LayaGL"; export class SkinMeshBuffer { constructor() { var gl = LayaGL.instance; this.ib = IndexBuffer2D.create(gl.DYNAMIC_DRAW); this.vb = VertexBuffer2D.create(8); } static getInstance() { return SkinMeshBuffer.instance = SkinMeshBuffer.instance || new SkinMeshBuffer(); } addSkinMesh(skinMesh) { skinMesh.getData2(this.vb, this.ib, this.vb._byteLength / 32); } reset() { this.vb.clear(); this.ib.clear(); } }