修改完成,todo 关卡设计
This commit is contained in:
@@ -45,8 +45,6 @@ export class HeroHomeComp extends CCComp {
|
||||
this.role=smc.heros[uuid]
|
||||
this.hero=HeroInfo[uuid]
|
||||
console.log("hero_show",uuid)
|
||||
let tal=this.node.getChildByName("sk").getChildByName("tal");
|
||||
let sk_node= this.node.getChildByName("sk");
|
||||
let skill1 = SkillSet[this.hero.sk1[0]]
|
||||
let skill2 = SkillSet[this.hero.sk2[0]]
|
||||
var sk_path = "game/skills/skill_icon"
|
||||
@@ -59,17 +57,17 @@ export class HeroHomeComp extends CCComp {
|
||||
sprite.spriteFrame = atlas.getSpriteFrame(this.hero.path);
|
||||
});
|
||||
resources.load(sk_path, SpriteAtlas, (err: any, atlas) => {
|
||||
const sprite = this.node.getChildByName("sk").getChildByName("skicon").getChildByName("Mask").getChildByName("icon").getComponent(Sprite);
|
||||
const sprite = this.node.getChildByName("bottom").getChildByName("sk").getChildByName("skicon").getChildByName("Mask").getChildByName("icon").getComponent(Sprite);
|
||||
sprite.spriteFrame = atlas.getSpriteFrame(skill1.path);
|
||||
});
|
||||
this.node.getChildByName("sk").getChildByName("name").getComponent(Label).string = skill1.name;
|
||||
this.node.getChildByName("sk").getChildByName("info").getComponent(Label).string = skill1.info;
|
||||
this.node.getChildByName("bottom").getChildByName("sk").getChildByName("name").getComponent(Label).string = skill1.name;
|
||||
this.node.getChildByName("bottom").getChildByName("sk").getChildByName("info").getComponent(Label).string = skill1.info;
|
||||
resources.load(sk_path, SpriteAtlas, (err: any, atlas) => {
|
||||
const sprite = this.node.getChildByName("sk2").getChildByName("skicon").getChildByName("Mask").getChildByName("icon").getComponent(Sprite);
|
||||
const sprite = this.node.getChildByName("bottom").getChildByName("sk2").getChildByName("skicon").getChildByName("Mask").getChildByName("icon").getComponent(Sprite);
|
||||
sprite.spriteFrame = atlas.getSpriteFrame(skill2.path);
|
||||
});
|
||||
this.node.getChildByName("sk2").getChildByName("name").getComponent(Label).string = skill2.name;
|
||||
this.node.getChildByName("sk2").getChildByName("info").getComponent(Label).string = skill2.info;
|
||||
this.node.getChildByName("bottom").getChildByName("sk2").getChildByName("name").getComponent(Label).string = skill2.name;
|
||||
this.node.getChildByName("bottom").getChildByName("sk2").getChildByName("info").getComponent(Label).string = skill2.info;
|
||||
|
||||
// tal.getChildByName("slv1").getChildByName("val").getComponent(Label).string = this.hero.tals[0]
|
||||
// tal.getChildByName("slv2").getChildByName("val").getComponent(Label).string = this.hero.tals[1]
|
||||
@@ -116,10 +114,10 @@ export class HeroHomeComp extends CCComp {
|
||||
slvup.getChildByName("btned").active=false
|
||||
};
|
||||
if( this.role.slv==0) {
|
||||
this.node.getChildByName("call").getChildByName("cost").getChildByName("need").getComponent(Label).string = ((SlvUp[this.role.slv]-HeroInfo[this.h_uuid].slvexp)*(1+this.role.slv)).toString()
|
||||
this.node.getChildByName("call").getChildByName("cost").getChildByName("num").getComponent(Label).string = smc.heros[this.h_uuid].num.toString()
|
||||
this.node.getChildByName("call").getChildByName("cost").getChildByName("bar").getComponent(ProgressBar).progress = smc.heros[this.h_uuid].num/((SlvUp[this.role.slv]-HeroInfo[this.h_uuid].slvexp)*(1+this.role.slv))
|
||||
let hchipcomp= this.node.getChildByName("call").getChildByName("cost").getChildByName("hchip").getComponent(HChipComp)
|
||||
this.node.getChildByName("call").getChildByName("Node").getChildByName("cost").getChildByName("need").getComponent(Label).string = ((SlvUp[this.role.slv]-HeroInfo[this.h_uuid].slvexp)*(1+this.role.slv)).toString()
|
||||
this.node.getChildByName("call").getChildByName("Node").getChildByName("cost").getChildByName("num").getComponent(Label).string = smc.heros[this.h_uuid].num.toString()
|
||||
this.node.getChildByName("call").getChildByName("Node").getChildByName("cost").getChildByName("bar").getComponent(ProgressBar).progress = smc.heros[this.h_uuid].num/((SlvUp[this.role.slv]-HeroInfo[this.h_uuid].slvexp)*(1+this.role.slv))
|
||||
let hchipcomp= this.node.getChildByName("call").getChildByName("Node").getChildByName("cost").getChildByName("hchip").getComponent(HChipComp)
|
||||
hchipcomp.update_data(this.h_uuid,0)
|
||||
this.node.getChildByName("call").active=true
|
||||
}else{
|
||||
@@ -153,7 +151,7 @@ export class HeroHomeComp extends CCComp {
|
||||
let attr2 = this.node.getChildByName("attr2")
|
||||
let info = this.node.getChildByName("info")
|
||||
let lvup = this.node.getChildByName("lvup")
|
||||
let sk = this.node.getChildByName("sk")
|
||||
let sk = this.node.getChildByName("bottom").getChildByName("sk")
|
||||
let slvup = this.node.getChildByName("slvup")
|
||||
if(val < 0){
|
||||
tween(hero).to(0.2,{position:v3(0,hero.position.y)}).start()
|
||||
|
||||
Reference in New Issue
Block a user