import {_decorator, Component, director, Label, RichText} from "cc"; import {EventName} from "db://assets/core_tgx/easy_ui_framework/EventName"; const { ccclass, property } = _decorator; @ccclass export default class LanguageLabel extends Component { label = null; @property key: string = 'count'; // LIFE-CYCLE CALLBACKS: onLoad () { director.on(EventName.update_language,this._updateLanguage,this); } protected onDestroy() { director.off(EventName.update_language,this._updateLanguage,this); } start () { this._updateLanguage(); } protected onEnable(): void { this._updateLanguage(); } private _updateLanguage() : void{ // this.label = this.node.getComponent(Label); // if(!this.label)this.label = this.node.getComponent(RichText); // let str = LanguageMgr.getLanguage(this.key); // if(this.label){ // this.label.string = str; // } } // update (dt) {} }