技能碎片完成

This commit is contained in:
panw
2024-12-17 16:55:50 +08:00
parent 3aca9948f2
commit a05d7a4507
8 changed files with 956 additions and 24 deletions

View File

@@ -4,6 +4,7 @@ import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/modu
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
import { Items } from "../common/config/Items";
import { HChipComp } from "../hero/HChipComp";
import { SChipComp } from "../hero/SChipComp";
const { ccclass, property } = _decorator;
@@ -33,11 +34,17 @@ export class RewardComp extends CCComp {
if(type==1){
this.node.getChildByName("icon").active=false
this.node.getChildByName("hchip").active=true
let hchipcomp= this.node.getChildByName("hchip").getComponent(HChipComp)
hchipcomp.update_data(uuid,0)
let hc= this.node.getChildByName("hchip").getComponent(HChipComp)
hc.update_data(uuid,0)
}
if(type==2){
this.node.getChildByName("icon").active=false
this.node.getChildByName("schip").active=true
let sc= this.node.getChildByName("schip").getComponent(SChipComp)
sc.update_data(uuid,0)
}
this.node.getChildByName("x1").getComponent(Label).string = x1.toString()
this.node.getChildByName("x10").getComponent(Label).string = x10.toString()
this.node.parent = parent

View File

@@ -41,26 +41,27 @@ export class VictoryComp extends CCComp {
smc.vmdata.exp.x10=smc.vmdata.exp.x1*9
}
var parent = this.node.getChildByName("items")
var path = "game/gui/reward";
var prefab: Prefab = oops.res.get(path, Prefab)!;
for (let i in smc.items) {
if(smc.items[i].x1 > 0){
smc.items[i].x10 =smc.items[i].x1*9
var path = "game/gui/reward";
var prefab: Prefab = oops.res.get(path, Prefab)!;
console.log("VictoryComp",prefab,smc.items[i])
var node = instantiate(prefab);
let rc:any= node.getComponent(RewardComp)!;
rc.init(smc.items[i].uuid,smc.items[i].x1,smc.items[i].x10,parent,0)
}
}
for (let i in smc.skills) {
if(smc.skills[i].x1 > 0){
smc.skills[i].x10 =smc.skills[i].x1*9
var node = instantiate(prefab);
let rc:any= node.getComponent(RewardComp)!;
rc.init(smc.skills[i].uuid,smc.skills[i].x1,smc.skills[i].x10,parent,2)
}
}
for (let i in smc.heros) {
if(smc.heros[i].x1 > 0){
smc.heros[i].x10 =smc.heros[i].x1*9
var path = "game/gui/reward";
var prefab: Prefab = oops.res.get(path, Prefab)!;
console.log("VictoryComp",prefab,smc.heros[i])
var node = instantiate(prefab);
let rc:any= node.getComponent(RewardComp)!;
rc.init(smc.heros[i].uuid,smc.heros[i].x1,smc.heros[i].x10,parent,1)