永久数据不再mvvm显示
This commit is contained in:
27
assets/script/game/map/MInfoComp.ts
Normal file
27
assets/script/game/map/MInfoComp.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
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()+" 关"
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user