/*
 * @Author: mojunshou 1637302775@qq.com
 * @Date: 2025-04-18 19:35:48
 * @LastEditors: mojunshou 1637302775@qq.com
 * @LastEditTime: 2025-04-27 18:52:30
 * @Description: 解锁功能
 */
import { _decorator, Component, Node } from 'cc';
import { GameComponent } from 'db://oops-framework/module/common/GameComponent';
import { UIID } from '../../common/config/GameUIConfig';
import { oops } from 'db://oops-framework/core/Oops';
import { GameEvent } from '../../common/config/GameEvent';
import { ServerHandler } from '../../common/manager/ServerHandler';
import { smc } from '../../common/SingletonModuleComp';
const { ccclass, property } = _decorator;

@ccclass('UnlockFunction')
export class UnlockFunction extends GameComponent {
    start() {
        this.setButton();
    }


    btn_confirm() {
        oops.gui.remove(UIID.UnlockFunction);
        //发送开始自动玩游戏
        oops.message.dispatchEvent(GameEvent.StartAutoGame);
        this.updateState();
    }


    //更新状态
    updateState() {
        ServerHandler.inst.updatePopupState({
            level: smc.account.AccountModel.curLevel,
            type: smc.game.GameModel.popupType
        })

    }
}


