物品ui修改 完善
This commit is contained in:
@@ -8,6 +8,7 @@ import { SkillSet } from "../common/config/SkillSet";
|
||||
import { HeroInfo, HeroSet } from "../common/config/heroSet";
|
||||
import { Hero } from "../hero/Hero";
|
||||
import { HChipComp } from "../hero/HChipComp";
|
||||
import { ItemComp } from "./ItemComp";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** 视图层对象 */
|
||||
@@ -23,31 +24,9 @@ export class ItemInfoComp extends CCComp {
|
||||
this.node.getChildByName("item").active = true;
|
||||
this.node.getChildByName("name").getComponent(Label).string=Items[args.uuid].name
|
||||
this.node.getChildByName("info").getComponent(Label).string=Items[args.uuid].info
|
||||
let url = "gui/items";
|
||||
let pathName= Items[args.uuid].path;
|
||||
this.node.getChildByName("item").getChildByName("lv1").active = false;
|
||||
this.node.getChildByName("item").getChildByName("lv2").active = false;
|
||||
this.node.getChildByName("item").getChildByName("lv3").active = false;
|
||||
this.node.getChildByName("item").getChildByName("lv4").active = false;
|
||||
|
||||
switch(Items[args.uuid].lv){
|
||||
case 1:
|
||||
this.node.getChildByName("item").getChildByName("lv1").active = true;
|
||||
break;
|
||||
case 2:
|
||||
this.node.getChildByName("item").getChildByName("lv2").active = true;
|
||||
break;
|
||||
case 3:
|
||||
this.node.getChildByName("item").getChildByName("lv3").active = true;
|
||||
break;
|
||||
case 4:
|
||||
this.node.getChildByName("item").getChildByName("lv4").active = true;
|
||||
break;
|
||||
}
|
||||
resources.load(url, SpriteAtlas, (err: any, atlas) => {
|
||||
const sprite = this.node.getChildByName("item").getChildByName("icon").getComponent(Sprite);
|
||||
sprite.spriteFrame = atlas.getSpriteFrame(pathName);
|
||||
});
|
||||
let itemcom = this.node.getChildByName("item").getComponent(ItemComp);
|
||||
itemcom.update_data(args.uuid,args.num);
|
||||
}
|
||||
if(args.type==1){ //技能碎片
|
||||
this.node.getChildByName("skill").active = true;
|
||||
@@ -59,13 +38,12 @@ export class ItemInfoComp extends CCComp {
|
||||
// console.log("update_data",atlas,sprite)
|
||||
sprite.spriteFrame = atlas.getSpriteFrame(SkillSet[args.uuid].path);
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
if(args.type==2){ //英雄碎片
|
||||
this.node.getChildByName("hero").active = true;
|
||||
this.node.getChildByName("name").getComponent(Label).string=HeroInfo[args.uuid].name+" 碎片"
|
||||
this.node.getChildByName("info").getComponent(Label).string="「"+HeroInfo[args.uuid].name+"」碎片,用于英雄升阶,开宝箱获得"
|
||||
this.node.getChildByName("info").getComponent(Label).string="「"+HeroInfo[args.uuid].name+"」碎片,用于强化英雄,怪物掉落和开宝箱抽卡获得"
|
||||
let HChip=this.node.getChildByName("hero").getComponent(HChipComp);
|
||||
HChip.update_data(args.uuid)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user