| 12345678910111213141516171819202122232425262728293031323334 |
- import { _decorator, Component, Node } from 'cc';
- import { GameComponent } from 'db://oops-framework/module/common/GameComponent';
- import { GameEvent } from '../../common/config/GameEvent';
- import { oops } from 'db://oops-framework/core/Oops';
- import { UIID } from '../../common/config/GameUIConfig';
- import { ServerHandler } from '../../common/manager/ServerHandler';
- import { smc } from '../../common/SingletonModuleComp';
- const { ccclass, property } = _decorator;
- @ccclass('UnlockDoubleSpeed')
- export class UnlockDoubleSpeed extends GameComponent {
- start() {
- this.setButton();
- oops.message.dispatchEvent(GameEvent.updateGameState, "paused");
- }
- btn_confirm() {
- oops.gui.remove(UIID.UnlockDoubleSpeed);
- //发送开始自动玩游戏
- oops.message.dispatchEvent(GameEvent.DoubleSpeedOpenSuccess);
- this.updateState();
- }
- //更新状态
- updateState() {
- ServerHandler.inst.updatePopupState({
- level: smc.account.AccountModel.curLevel,
- type: smc.game.GameModel.popupType
- })
- }
- }
|