update
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
Sprite,
|
||||
} from "cc";
|
||||
import { DemoManager } from "../DemoManager";
|
||||
import { Character, characters } from "db://assets/Scripts/test/cfg/characters";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass("GirlListItem")
|
||||
@@ -24,19 +25,17 @@ export class GirlListItem extends Component {
|
||||
chatBtn: Node;
|
||||
|
||||
id: number = -1;
|
||||
start() {
|
||||
// this.avatar = this.node
|
||||
// .getChildByName("avatar/Avatar")
|
||||
// .getComponent(Sprite);
|
||||
// this.girlName = this.node.getChildByName("Desc/Name").getComponent(Label);
|
||||
// this.desc = this.node.getChildByName("Desc/desc").getComponent(Label);
|
||||
// this.price = this.node.getChildByName("purchase/price").getComponent(Label);
|
||||
// this.chatBtn = this.node.getChildByName("purchase/Button");
|
||||
|
||||
this.id = 1;
|
||||
protected onEnable(): void {
|
||||
this.refreshData(1);
|
||||
}
|
||||
|
||||
refreshData() {}
|
||||
refreshData(index: number) {
|
||||
const data = characters[index - 1];
|
||||
this.id = data.id;
|
||||
this.girlName.string = data.name;
|
||||
//this.avatar.spriteFrame =
|
||||
}
|
||||
|
||||
onClickDetail() {
|
||||
DemoManager.getInstance().EnterDetail(this.id);
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
import { _decorator, Component, Node } from 'cc';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('GirlListPanel')
|
||||
export class GirlListPanel extends Component {
|
||||
start() {
|
||||
|
||||
}
|
||||
|
||||
update(deltaTime: number) {
|
||||
|
||||
}
|
||||
}
|
||||
␍
|
||||
import { _decorator, Component, Node } from 'cc';
|
||||
import {characters} from "db://assets/Scripts/test/cfg/characters";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('GirlListPanel')
|
||||
export class GirlListPanel extends Component {
|
||||
onEnable()
|
||||
{
|
||||
const cfg = characters;
|
||||
for (let i = 0; i < cfg.length; i++) {
|
||||
const c = cfg[i];
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user