ui完善
This commit is contained in:
@@ -6,21 +6,20 @@ type:
|
||||
*/
|
||||
|
||||
export const Items={
|
||||
1001:{uuid: 1001,path: "5017",type: 1,r_num:10,name: "训练凭证",info:"通过训练,提升普等级", },
|
||||
1002:{uuid: 1002,path: "2009",type: 1,r_num:10,name: "高级训练凭证",info:"通过高等级训练,提升高50级以上英雄等级", },
|
||||
1003:{uuid: 1003,path: "1002",type: 1,r_num:10,name: "英雄原石",info:"一星英雄升星", },
|
||||
1004:{uuid: 1004,path: "1005",type: 1,r_num:1,name: "高级英雄原石",info:"二星英雄升星", },
|
||||
1005:{uuid: 1005,path: "1008",type: 1,r_num:1,name: "稀有英雄原石",info:"三星英雄升星", },
|
||||
1006:{uuid: 1006,path: "1011",type: 1,r_num:1,name: "传说英雄原石",info:"四星英雄升星", },
|
||||
1007:{uuid: 1007,path: "5017",type: 1,r_num:1,name: "招募券",info:"招募英雄", },
|
||||
1021:{uuid: 1021,path: "2301",type: 1,r_num:1,name: "普通攻击石",info:"增加装备攻击力", },
|
||||
1022:{uuid: 1022,path: "2302",type: 1,r_num:1,name: "高级攻击石",info:"增加装备攻击力", },
|
||||
1023:{uuid: 1023,path: "2303",type: 1,r_num:1,name: "稀有攻击石",info:"增加装备攻击力", },
|
||||
1024:{uuid: 1024,path: "2304",type: 1,r_num:1,name: "传说攻击石",info:"增加装备攻击力", },
|
||||
1025:{uuid: 1025,path: "2306",type: 1,r_num:1,name: "普通生命石",info:"增加装备生命值", },
|
||||
1026:{uuid: 1026,path: "2307",type: 1,r_num:1,name: "高级生命石",info:"增加装备生命值", },
|
||||
1027:{uuid: 1027,path: "2308",type: 1,r_num:1,name: "稀有生命石",info:"增加装备生命值", },
|
||||
1028:{uuid: 1028,path: "2309",type: 1,r_num:1,name: "传说生命石",info:"增加装备生命值", },
|
||||
9001:{uuid: 9001,path: "9001",type: 1,r_num:1,name: "金币",info:"金币不是万能的,但是没有金币是万万不能的", },
|
||||
1001:{uuid: 1001,path: "3011",type:1,lv:1,r_num:10,name: "近战卷轴",info:"提升近战英雄等级", },
|
||||
1002:{uuid: 1002,path: "3012",type:1,lv:1,r_num:10,name: "远程卷轴",info:"提升远程英雄等级", },
|
||||
1003:{uuid: 1003,path: "3013",type:1,lv:1,r_num:10,name: "辅助卷轴",info:"提升辅助英雄等级", },
|
||||
1004:{uuid: 1004,path: "2011",type:1,lv:2,r_num:10,name: "近战凭证",info:"提升近战英雄星级", },
|
||||
1005:{uuid: 1005,path: "2012",type:1,lv:2,r_num:10,name: "远程凭证",info:"提升远程英雄星级", },
|
||||
1006:{uuid: 1006,path: "2013",type:1,lv:2,r_num:10,name: "辅助凭证",info:"提升辅助英雄星级", },
|
||||
1021:{uuid: 1021,path: "1001",type:1,lv:1,r_num:1,name: "普通攻击石",info:"增加装备攻击力10,成功几率20%", },
|
||||
1022:{uuid: 1022,path: "1004",type:1,lv:2,r_num:1,name: "高级攻击石",info:"增加装备攻击力10,成功几率30%", },
|
||||
1023:{uuid: 1023,path: "1007",type:1,lv:3,r_num:1,name: "稀有攻击石",info:"增加装备攻击力10,成功几率40%", },
|
||||
1024:{uuid: 1024,path: "1010",type:1,lv:4,r_num:1,name: "传说攻击石",info:"增加装备攻击力10,成功几率50%", },
|
||||
1025:{uuid: 1025,path: "1002",type:1,lv:1,r_num:1,name: "普通生命石",info:"增加装备生命值50,成功几率20%", },
|
||||
1026:{uuid: 1026,path: "1005",type:1,lv:2,r_num:1,name: "高级生命石",info:"增加装备生命值50,成功几率30%", },
|
||||
1027:{uuid: 1027,path: "1008",type:1,lv:3,r_num:1,name: "稀有生命石",info:"增加装备生命值50,成功几率40%", },
|
||||
1028:{uuid: 1028,path: "1011",type:1,lv:4,r_num:1,name: "传说生命石",info:"增加装备生命值50,成功几率50%", },
|
||||
9001:{uuid: 9001,path: "9001",type:1,lv:0,r_num:1,name: "金币",info:"金币不是万能的,但是没有金币是万万不能的", },
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ export const MissionSet = [
|
||||
|
||||
|
||||
export const MissionReward = {
|
||||
1:[1001,1002,1003,1004,1005,1006,1007,1021,1022,1023,1024,1025,1026,1027,1028],
|
||||
2:[1001,1002,1003,1004,1005,1006,1007,1021,1022,1023,1024,1025,1026,1027,1028],
|
||||
3:[1001,1002,1003,1004,1005,1006,1007,1021,1022,1023,1024,1025,1026,1027,1028],
|
||||
1:[1001,1002,1003,1004,1005,1006,1021,1022,1023,1024,1025,1026,1027,1028],
|
||||
2:[1001,1002,1003,1004,1005,1006,1021,1022,1023,1024,1025,1026,1027,1028],
|
||||
3:[1001,1002,1003,1004,1005,1006,1021,1022,1023,1024,1025,1026,1027,1028],
|
||||
}
|
||||
|
||||
@@ -16,8 +16,23 @@ export class Item extends ecs.Entity {
|
||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||
var node = instantiate(prefab);
|
||||
node.getChildByName("num").getComponent(Label).string = num.toString();
|
||||
|
||||
let url = "gui/items";
|
||||
let pathName= Items[uuid].path;
|
||||
switch(Items[uuid].lv){
|
||||
case 1:
|
||||
node.getChildByName("lv1").active = true;
|
||||
break;
|
||||
case 2:
|
||||
node.getChildByName("lv2").active = true;
|
||||
break;
|
||||
case 3:
|
||||
node.getChildByName("lv3").active = true;
|
||||
break;
|
||||
case 4:
|
||||
node.getChildByName("lv4").active = true;
|
||||
break;
|
||||
}
|
||||
resources.load(url, SpriteAtlas, (err: any, atlas) => {
|
||||
const sprite = node.getChildByName("icon").getComponent(Sprite);
|
||||
sprite.spriteFrame = atlas.getSpriteFrame(pathName);
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -45,10 +45,10 @@ export class VictoryComp extends CCComp {
|
||||
this.rewards[0]={uuid:9001,num:gold}
|
||||
for (let x = 1; x <= conut; x++) {
|
||||
let item=ecs.getEntity<Item>(Item)
|
||||
let r_i:any = RandomManager.instance.getRandomInt(0,MissionReward[this.reward_lv].length);
|
||||
let r_i:any = RandomManager.instance.getRandomInt(0,MissionReward[this.reward_lv].length-1);
|
||||
let ii = MissionReward[this.reward_lv][r_i];
|
||||
let im = Items[ii];
|
||||
// console.log("reward",r_i,ii,im)
|
||||
console.log("reward",r_i,ii,im)
|
||||
item.load(im.uuid,im.r_num,parent)
|
||||
this.rewards[x]={uuid:im.uuid,num:im.r_num}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user