update
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import { _decorator, Component, Node,instantiate } from 'cc';
|
||||
import {characters} from "db://assets/Scripts/test/cfg/characters";
|
||||
import li_BaseView from "db://assets/Scripts/Main/Common/li_BaseView";
|
||||
import Utils from "db://assets/Scripts/Main/Common/Utils";
|
||||
import {GirlListItem} from "db://assets/Scripts/test/girlListPanel/GirlListItem";
|
||||
import {characters, GirlsData} from "db://assets/Scripts/Main/Config/cfg/characters";
|
||||
import {GButton} from "db://assets/Scripts/Main/Common/GButton";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('GirlListPanel')
|
||||
@@ -13,17 +14,24 @@ export class GirlListPanel extends li_BaseView {
|
||||
content:Node;
|
||||
|
||||
cache:GirlListItem[] = [];
|
||||
|
||||
id:number;
|
||||
openUIDataCT(data)
|
||||
{
|
||||
this.id = data;
|
||||
}
|
||||
onLoadCT() {
|
||||
Utils.parseNode(this.node,this._nodeTab);
|
||||
this.registerListener();
|
||||
this.itemInst = this._nodeTab.BubbleItem.getComponent(GirlListItem);
|
||||
this.itemInst.node.active = false;
|
||||
this.content = this._nodeTab.content;
|
||||
this.show();
|
||||
this.refresh(this.id);
|
||||
|
||||
}
|
||||
|
||||
|
||||
show()
|
||||
refresh(index:number)
|
||||
{
|
||||
if(this.cache)
|
||||
{
|
||||
@@ -32,7 +40,7 @@ export class GirlListPanel extends li_BaseView {
|
||||
this.cache[i].node.destroy();
|
||||
}
|
||||
}
|
||||
const config = characters;
|
||||
const config = GirlsData.filter(value=>value.category == index);
|
||||
for (let i = 0; i < config.length; i++) {
|
||||
const cfg = config[i];
|
||||
let newNode = instantiate(this.itemInst.node)
|
||||
@@ -46,7 +54,14 @@ export class GirlListPanel extends li_BaseView {
|
||||
|
||||
|
||||
|
||||
private registerListener() {}
|
||||
private registerListener() {
|
||||
GButton.BandClick(this._nodeTab.ReturnBtn,this.Return,this);
|
||||
}
|
||||
Return()
|
||||
{
|
||||
this.onClose();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user