import { _decorator, Component, Node,Event } from 'cc';
import BaseUI from '../../scripts/base/BaseUI';
import { Hall } from '../hall/Hall';
import { LanguageManager } from '../../scripts/utils/LanguageManager';
const { ccclass, property } = _decorator;

@ccclass('SettingsLayer')
export class SettingsLayer extends BaseUI {
    static async show() {
      let layer = await Hall.ins.showLayer("prefab/layer/SettingsLayer");
    //   layer.getComponent(SettingsLayer).init();
    }
    init() {
       
    }

    protected onLoad(): void {
        super.onLoad();
    }

    protected onBtnClick(name: string, event: Event, customEventData: any): void { 
      super.onBtnClick(name,event,customEventData);
        switch (name) {
            case "btn_zh":
                LanguageManager.switchLanguage("zh");
                break;
            case "btn_en":
                LanguageManager.switchLanguage("en");
                break;
        }
    }
}

