import { _decorator, Component, EditBox, game, instantiate, Label, Node, Prefab } from 'cc'; import { UtilsPanel } from '../../scene/script/UtilsPanel'; import { Generate } from '../../scene/script/components/Generate'; const { ccclass, property } = _decorator; @ccclass('Pay') export class Pay extends Component { public static bundle_name = "pay"; private node_descid: Node = null; private node_buy: Node = null; private gene_items: Generate = null; private lb_money: Label = null; private edit_id: EditBox = null; protected onLoad(){ UtilsPanel.getAllNeedCom(this, this.node, false); UtilsPanel.addBtnEvent(this.node_buy, this.onBuy, this); //@ts-ignore game.on("select_item", this.onSelect, this); } protected start(): void { this.gene_items.initData(new Array(6)); } private onEditChange(){ this.node_descid.active = this.edit_id.string.length == 0; } private onSelect(index:number){ this.lb_money.string = index * 1000 + ""; } private onBuy(){ } }