import { _decorator, Component, Label, Node } from 'cc'; import { oops } from 'db://oops-framework/core/Oops'; import { GameEvent } from '../common/config/GameEvent'; import { smc } from '../common/SingletonModuleComp'; const { ccclass, property } = _decorator; @ccclass('MInfoComp') export class MInfoComp extends Component { protected onLoad(): void { oops.message.on(GameEvent.MISSION_UPDATE,this.onMissionUpdate,this); this.update_mission(smc.data.mission) } start() { this.update_mission(smc.data.mission) } onMissionUpdate(event:string,data:any){ this.update_mission(smc.data.mission) } update_mission(mission:number){ this.node.getChildByName("mission").getComponent(Label).string="第 "+mission.toString()+" 关" } }