有错误,需要解决

This commit is contained in:
2024-11-22 16:58:21 +08:00
parent 7fa1ae1194
commit a61b4aece6
4 changed files with 887 additions and 368 deletions

View File

@@ -36,10 +36,18 @@ export class VictoryComp extends CCComp {
this.node.getChildByName("Node").getChildByName("defeat").active = true
}
getReward(){
let reward:any = RandomManager.instance.getRandomByObjectList(MissionReward[this.reward_lv], 1);
this.rerawd_item =Items[reward[0]]
// console.log("getReward:",this.rerawd_item)
this.node.getChildByName("Node").getChildByName("item3").getChildByName("num").getComponent(Label).string=this.reward_num.toString()
let reward:any = RandomManager.instance.getRandomByObjectList(MissionReward[this.reward_lv], 2);
let item1 =Items[reward[0]]
let item2 =Items[reward[1]]
let r1_num=0
let r2_num=0
console.log("getReward:",reward,item1,item2)
this.node.getChildByName("Node").getChildByName("item2").getChildByName("num").getComponent(Label).string=item1.r_num.toString()
this.node.getChildByName("Node").getChildByName("item2").getChildByName("name").getComponent(Label).string=item1.name.toString()
this.node.getChildByName("Node").getChildByName("item3").getChildByName("num").getComponent(Label).string=item2.r_num.toString()
this.node.getChildByName("Node").getChildByName("item3").getChildByName("name").getComponent(Label).string=item2.r_num.toString()
}
end_mission(){
this.node.getChildByName("Node").active=false