import { _decorator, Node, 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"; import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops"; import { GameEvent } from "../common/config/GameEvent"; import { smc } from "../common/SingletonModuleComp"; const { ccclass, property } = _decorator; /** 视图层对象 */ @ccclass('MissionGetsCompComp') @ecs.register('MissionGetsComp', false) export class MissionGetsCompComp extends CCComp { start() { } onDestroy() { } load_hui(uuid:number, pos_index: number){ var path = "game/gui/get"; } private updateNodeNum(node: Node, num: number) { if (!node) return; // Try to find Label on the node itself let label = node.getComponent(Label); // If not found, try to find a child named "num" with Label if (!label) { const numNode = node.getChildByName("num"); if (numNode) { label = numNode.getComponent(Label); } } if (label) { label.string = num > 0 ? num.toString() : ""; } } /** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */ reset() { this.node.destroy(); } }