24 lines
746 B
TypeScript
24 lines
746 B
TypeScript
import { _decorator, Label } from "cc";
|
|
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
|
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
|
|
|
const { ccclass, property } = _decorator;
|
|
|
|
/** 视图层对象 */
|
|
@ccclass('ItemComp')
|
|
@ecs.register('ItemComp', false)
|
|
export class ItemComp extends CCComp {
|
|
i_uuid:number = 0;
|
|
num:number = 0;
|
|
start() {
|
|
this.node.getChildByName("num").getComponent(Label).string = this.num.toString();
|
|
//todo 设定icon 显示
|
|
}
|
|
|
|
|
|
|
|
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
|
reset() {
|
|
this.node.destroy();
|
|
}
|
|
} |