HuaweiDemo/assets/script/framework/util/staticBatch.ts
2023-11-07 09:17:57 +08:00

16 lines
373 B
TypeScript

import { _decorator, Component, Node, BatchingUtility } from 'cc';
const { ccclass, property } = _decorator;
@ccclass('StaticBatch')
export class StaticBatch extends Component {
@property([Node])
needBatches: Node[] = [];
start () {
this.needBatches.forEach((node)=>{
BatchingUtility.batchStaticModel(node, this.node);
})
}
}