1234567891011121314151617181920212223242526272829303132 |
- import { _decorator, Component, Node } from 'cc';
- import { TableUtil } from './TableUtil';
- const { ccclass, property } = _decorator;
- @ccclass('table_store')
- export class table_store {
- static readonly TableName: string = "store";
- static get(id: number): table_store { return TableUtil.getTable(table_store, id) };
- static getList(): table_store[] { return TableUtil.getTables(table_store,5) };
- private data: any;
- init(id: number) {
- var table = TableUtil.get(table_store.TableName);
- this.data = table[id];
- if (!this.data) console.error("配置表" + table_store.TableName + "没有ID:" + id);
- this.id = id;
- }
- /** 编号【KEY】 */
- id: number = 0;
- get type(): number { return this.data.type }
- get cost(): number { return this.data.cost }
- get num(): number { return this.data.num }
- get name(): string { return this.data.name }
- }
|