英雄 技能 碎片重做, 商品页完善
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { _decorator } from "cc";
|
||||
import { _decorator, instantiate, Prefab, UITransform } from "cc";
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
||||
@@ -6,6 +6,9 @@ import { UIID } from "../common/config/GameUIConfig";
|
||||
import { Items } from "../common/config/Items";
|
||||
import { Item } from "./Item";
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
import { RewardComp } from "./RewardComp";
|
||||
import { SChipComp } from "../hero/SChipComp";
|
||||
import { HChipComp } from "../hero/HChipComp";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -18,11 +21,14 @@ export class ShopHomeComp extends CCComp {
|
||||
this.get_items();
|
||||
}
|
||||
get_items(){
|
||||
let free = this.node.getChildByName("goods_list").getChildByName("free").getChildByName("items");
|
||||
let goods1 = this.node.getChildByName("goods_list").getChildByName("goods1").getChildByName("items");
|
||||
let goods2 = this.node.getChildByName("goods_list").getChildByName("goods2").getChildByName("items");
|
||||
let goods3 = this.node.getChildByName("goods_list").getChildByName("goods3").getChildByName("items");
|
||||
|
||||
|
||||
let goods = this.node.getChildByName("goods").getChildByName("view").getChildByName("content")
|
||||
goods.getComponent(UITransform).height=5*200
|
||||
console.log("smc.goods",smc.goods)
|
||||
let free = goods.getChildByName("free").getChildByName("items");
|
||||
let goods1 = goods.getChildByName("goods1").getChildByName("items");
|
||||
let herochips = goods.getChildByName("herochips").getChildByName("items");
|
||||
let skillchips = goods.getChildByName("skillchips").getChildByName("items");
|
||||
for (let x = 0; x < smc.goods.free.length; x++) {
|
||||
let item=ecs.getEntity<Item>(Item)
|
||||
item.load(smc.goods.free[x].uuid,smc.goods.free[x].num,free)
|
||||
@@ -31,14 +37,22 @@ export class ShopHomeComp extends CCComp {
|
||||
let item=ecs.getEntity<Item>(Item)
|
||||
item.load(smc.goods.goods1[x].uuid,smc.goods.goods1[x].num,goods1)
|
||||
}
|
||||
for (let x = 0; x < smc.goods.goods2.length; x++) {
|
||||
let item=ecs.getEntity<Item>(Item)
|
||||
item.load(smc.goods.goods2[x].uuid,smc.goods.goods2[x].num,goods2)
|
||||
for (let x = 0; x < smc.goods.herochips.length; x++) {
|
||||
let path = "game/gui/hchip";
|
||||
let prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||
let node = instantiate(prefab);
|
||||
node.parent=herochips
|
||||
let hc= node.getComponent(HChipComp)
|
||||
hc.update_data(smc.goods.herochips[x].uuid,smc.goods.herochips[x].num)
|
||||
}
|
||||
|
||||
for (let x = 0; x < smc.goods.goods3.length; x++) {
|
||||
let item=ecs.getEntity<Item>(Item)
|
||||
item.load(smc.goods.goods3[x].uuid,smc.goods.goods3[x].num,goods3)
|
||||
for (let x = 0; x < smc.goods.skillchips.length; x++) {
|
||||
let path = "game/gui/schip";
|
||||
let prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||
let node = instantiate(prefab);
|
||||
node.parent=skillchips
|
||||
let sc= node.getComponent(SChipComp)
|
||||
sc.update_data(smc.goods.skillchips[x].uuid,smc.goods.skillchips[x].num)
|
||||
}
|
||||
// for (let x = 0; x < smc.goods.goods4.length; x++) {
|
||||
// let item=ecs.getEntity<Item>(Item)
|
||||
|
||||
Reference in New Issue
Block a user