技能碎片完成
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user