护盾改为 护甲值

This commit is contained in:
2025-08-17 12:25:22 +08:00
parent 6288d4e4bb
commit e5874bf936
15 changed files with 8903 additions and 8921 deletions

View File

@@ -16,49 +16,34 @@ export class VictoryComp extends CCComp {
reward_num:number=2
/** 视图层逻辑代码分离演示 */
protected onLoad(): void {
this.on(GameEvent.MissionStart,this.mission_start,this)
this.on(GameEvent.FightEnd,this.fight_end,this)
}
onAdded(args: any) {
console.log("[VictoryComp] onAdded",args)
this.node.getChildByName("title").getChildByName("victory").active=args.victory
this.node.getChildByName("title").getChildByName("defeat").active=!args.victory
this.node.getChildByName("btns").getChildByName("next").active=false
this.scheduleOnce(()=>{
this.node.getChildByName("btns").getChildByName("next").active=true
},0.2)
}
mission_start(){
this.hide()
}
fight_end(e:any,val:any){
this.node.getChildByName("title").getChildByName("victory").active=val.victory
this.node.getChildByName("title").getChildByName("defeat").active=!val.victory
this.open()
}
victory_end(){
this.hide()
oops.message.dispatchEvent(GameEvent.MissionEnd)
oops.gui.removeByNode(this.node)
}
restart(){
this.hide()
oops.message.dispatchEvent(GameEvent.MissionStart)
oops.gui.removeByNode(this.node)
}
open(){
this.show()
}
show(){
this.node.setPosition(v3(0,640,0))
}
hide(){
this.node.setPosition(v3(-1500,640,0))
}
do_x10(){
this.clear_x1()
}
do_x1(){
this.clear_x1()
}
clear_x1(){
this.victory_end()
}
item_show(e:any,val:any){
console.log("item_show",val)
}
protected onDestroy(): void {
console.log("释放胜利界面");
}