配置全部转移luban
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import { _decorator, Component, Node, instantiate } from "cc";
|
||||
import li_BaseView from "db://assets/Scripts/Main/Common/li_BaseView";
|
||||
import Utils from "db://assets/Scripts/Main/Common/Utils";
|
||||
import { GirlsData } from "db://assets/Scripts/Main/Config/cfg/characters";
|
||||
import { GButton } from "db://assets/Scripts/Main/Common/GButton";
|
||||
import { GirlListItem } from "./GirlListItem";
|
||||
import ConfigManager from "../../manager/ConfigManager";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass("GirlListPanel")
|
||||
@@ -15,9 +15,9 @@ export class GirlListPanel extends li_BaseView {
|
||||
|
||||
cache: GirlListItem[] = [];
|
||||
|
||||
id: number;
|
||||
category: number;
|
||||
openUIDataCT(data) {
|
||||
this.id = data;
|
||||
this.category = data;
|
||||
}
|
||||
onLoadCT() {
|
||||
Utils.parseNode(this.node, this._nodeTab);
|
||||
@@ -25,16 +25,17 @@ export class GirlListPanel extends li_BaseView {
|
||||
this.itemInst = this._nodeTab.BubbleItem.getComponent(GirlListItem);
|
||||
this.itemInst.node.active = false;
|
||||
this.content = this._nodeTab.content;
|
||||
this.refresh(this.id);
|
||||
this.refresh(this.category);
|
||||
}
|
||||
|
||||
refresh(index: number) {
|
||||
refresh(category: number) {
|
||||
if (this.cache) {
|
||||
for (let i = this.cache.length - 1; i >= 0; i--) {
|
||||
this.cache[i].node.destroy();
|
||||
}
|
||||
}
|
||||
const config = GirlsData.filter((value) => value.category == index);
|
||||
const GirlsData = ConfigManager.tables.TbGirls.getDataList();
|
||||
const config = GirlsData.filter((value) => value.category == category);
|
||||
for (let i = 0; i < config.length; i++) {
|
||||
const cfg = config[i];
|
||||
let newNode = instantiate(this.itemInst.node);
|
||||
|
||||
Reference in New Issue
Block a user