ui完善
This commit is contained in:
@@ -3,6 +3,7 @@ import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ec
|
||||
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
||||
import { UIID } from "../common/config/GameUIConfig";
|
||||
import { Items } from "../common/config/Items";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** 视图层对象 */
|
||||
@@ -14,8 +15,27 @@ export class ItemInfoComp extends CCComp {
|
||||
this.node.getChildByName("info").getComponent(Label).string=args.info
|
||||
let url = "gui/items";
|
||||
let pathName= args.path;
|
||||
this.node.getChildByName("lv1").active = false;
|
||||
this.node.getChildByName("lv2").active = false;
|
||||
this.node.getChildByName("lv3").active = false;
|
||||
this.node.getChildByName("lv4").active = false;
|
||||
|
||||
switch(Items[args.uuid].lv){
|
||||
case 1:
|
||||
this.node.getChildByName("lv1").active = true;
|
||||
break;
|
||||
case 2:
|
||||
this.node.getChildByName("lv2").active = true;
|
||||
break;
|
||||
case 3:
|
||||
this.node.getChildByName("lv3").active = true;
|
||||
break;
|
||||
case 4:
|
||||
this.node.getChildByName("lv4").active = true;
|
||||
break;
|
||||
}
|
||||
resources.load(url, SpriteAtlas, (err: any, atlas) => {
|
||||
const sprite = this.node.getChildByName("item_bg").getChildByName("icon").getComponent(Sprite);
|
||||
const sprite = this.node.getChildByName("icon").getComponent(Sprite);
|
||||
sprite.spriteFrame = atlas.getSpriteFrame(pathName);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user