123456789101112131415161718 |
- import { _decorator, Component, Node, Label } from 'cc';
- const { ccclass, property, requireComponent, menu } = _decorator;
- @ccclass('LabelEx')
- @requireComponent([Label])
- @menu('扩展组件/LabelEx')
- export class LabelEx extends Component {
- @property({ displayName: "对应文本表中的ID" })
- private text_id: number = -1;
- onLoad() {
- let lab = this.getComponent(Label);
- if (lab && this.text_id != -1) {
- //lab.string = TextConf.getSingle(this.text_id)?.text;
- //lab.cacheMode = Label.CacheMode.NONE;
- }
- }
- }
|