This commit is contained in:
2025-09-03 10:58:29 +08:00
parent 8e044fcf3c
commit 5b9c00fa7a
3 changed files with 1034 additions and 1585 deletions

View File

@@ -6,6 +6,7 @@ import { smc } from "../common/SingletonModuleComp";
import { GameEvent } from "../common/config/GameEvent";
import { ItemComp } from "./ItemComp";
import { startGuide } from "../common/config/Guide";
import { it } from "node:test";
const { ccclass, property } = _decorator;
@@ -36,9 +37,9 @@ export class VictoryComp extends CCComp {
this.add_reward(args.rewards)
this.rewards=args.rewards
}
this.node.getChildByName("box").getChildByName("exp").getChildByName("num").getComponent(Label)!.string="x"+this.game_data["exp"].toString()
this.node.getChildByName("box").getChildByName("gold").getChildByName("num").getComponent(Label)!.string="x"+this.game_data["gold"].toString()
this.node.getChildByName("box").getChildByName("diamond").getChildByName("num").getComponent(Label)!.string="x"+this.game_data["diamond"].toString()
this.node.getChildByName("box").getChildByName("items").getChildByName("exp").getChildByName("num").getComponent(Label)!.string="x"+this.game_data["exp"].toString()
this.node.getChildByName("box").getChildByName("items").getChildByName("gold").getChildByName("num").getComponent(Label)!.string="x"+this.game_data["gold"].toString()
this.node.getChildByName("box").getChildByName("items").getChildByName("diamond").getChildByName("num").getComponent(Label)!.string="x"+this.game_data["diamond"].toString()
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
@@ -76,7 +77,14 @@ export class VictoryComp extends CCComp {
diamond:0
}
this.rewards=[]
this.node.getChildByName("box").getChildByName("items").removeAllChildren()
let items=this.node.getChildByName("box").getChildByName("items")
items.children.forEach(element => {
if(element.name=="exp"||element.name=="gold"||element.name=="diamond"){
element.getChildByName("num").getComponent(Label)!.string="0"
}else{
element.destroy()
}
});
}
//看广告双倍
watch_ad(){