英雄界面基本完成
This commit is contained in:
@@ -7,6 +7,7 @@ import { smc } from "../common/SingletonModuleComp";
|
||||
import { UIID } from "../common/config/GameUIConfig";
|
||||
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
||||
import { Items } from "../common/config/Items";
|
||||
import { SkillSet } from "../common/config/SkillSet";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** 视图层对象 */
|
||||
@@ -42,12 +43,22 @@ export class HeroHomeComp extends CCComp {
|
||||
let hero =smc.heros[uuid]
|
||||
this.h_uuid=uuid
|
||||
let slv_node=this.node.getChildByName("name").getChildByName("slv");
|
||||
|
||||
let tal=this.node.getChildByName("slvup").getChildByName("tal");
|
||||
let sk_node= this.node.getChildByName("sk");
|
||||
let skill = SkillSet[hero.sk2[0]]
|
||||
var sk_path = "game/skills/skill_icon"
|
||||
var icon_path = "game/heros/herois"
|
||||
|
||||
resources.load(icon_path, SpriteAtlas, (err: any, atlas) => {
|
||||
const sprite = this.node.getChildByName("hero").getChildByName("icon").getComponent(Sprite);
|
||||
sprite.spriteFrame = atlas.getSpriteFrame(hero.path);
|
||||
});
|
||||
resources.load(sk_path, SpriteAtlas, (err: any, atlas) => {
|
||||
const sprite = sk_node.getChildByName("skicon").getChildByName("Mask").getChildByName("icon").getComponent(Sprite);
|
||||
sprite.spriteFrame = atlas.getSpriteFrame(skill.path);
|
||||
});
|
||||
sk_node.getChildByName("name").getComponent(Label).string = skill.name;
|
||||
sk_node.getChildByName("info").getComponent(Label).string = skill.info;
|
||||
this.node.getChildByName("name").getChildByName("value").getComponent(Label).string=hero.name
|
||||
this.node.getChildByName("name").getChildByName("lv").getComponent(Label).string = role.lv.toString()+"级";
|
||||
if( role.slv>=1) {slv_node.getChildByName("s1").active=true}else{slv_node.getChildByName("s1").active=false};
|
||||
@@ -61,6 +72,11 @@ export class HeroHomeComp extends CCComp {
|
||||
this.node.getChildByName("attr").getChildByName("acd").getChildByName("val").getComponent(Label).string = hero.a_cd
|
||||
this.node.getChildByName("attr").getChildByName("speed").getChildByName("val").getComponent(Label).string = hero.speed
|
||||
this.node.getChildByName("attr").getChildByName("dis").getChildByName("val").getComponent(Label).string = hero.dis
|
||||
tal.getChildByName("slv1").getChildByName("val").getComponent(Label).string = hero.tals[0]
|
||||
tal.getChildByName("slv2").getChildByName("val").getComponent(Label).string = hero.tals[1]
|
||||
tal.getChildByName("slv3").getChildByName("val").getComponent(Label).string = hero.tals[2]
|
||||
tal.getChildByName("slv4").getChildByName("val").getComponent(Label).string = hero.tals[3]
|
||||
tal.getChildByName("slv5").getChildByName("val").getComponent(Label).string = hero.tals[4]
|
||||
}
|
||||
lv_selcet(e:any,val:any){
|
||||
let active = this.node.getChildByName("menu").getChildByName("active")
|
||||
|
||||
Reference in New Issue
Block a user