UnlockFunction.ts 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * @Author: mojunshou 1637302775@qq.com
  3. * @Date: 2025-04-18 19:35:48
  4. * @LastEditors: mojunshou 1637302775@qq.com
  5. * @LastEditTime: 2025-04-19 10:20:50
  6. * @Description: 解锁功能
  7. */
  8. import { _decorator, Component, Node } from 'cc';
  9. import { GameComponent } from 'db://oops-framework/module/common/GameComponent';
  10. import { UIID } from '../../common/config/GameUIConfig';
  11. import { oops } from 'db://oops-framework/core/Oops';
  12. import { GameEvent } from '../../common/config/GameEvent';
  13. import { ServerHandler } from '../../common/manager/ServerHandler';
  14. import { smc } from '../../common/SingletonModuleComp';
  15. const { ccclass, property } = _decorator;
  16. @ccclass('UnlockFunction')
  17. export class UnlockFunction extends GameComponent {
  18. start() {
  19. this.setButton();
  20. this.updateState();
  21. }
  22. btn_confirm() {
  23. oops.gui.remove(UIID.UnlockFunction);
  24. //发送开始自动玩游戏
  25. oops.message.dispatchEvent(GameEvent.StartAutoGame);
  26. }
  27. //更新状态
  28. updateState() {
  29. ServerHandler.inst.updatePopupState({
  30. level: smc.account.AccountModel.curLevel,
  31. type: smc.game.GameModel.popupType
  32. })
  33. }
  34. }