| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- /*
- * @Author: mojunshou 1637302775@qq.com
- * @Date: 2025-03-21 11:17:22
- * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-23 17:40:03
- * @Description: 二倍速弹窗
- */
- import { _decorator } from "cc";
- import { oops } from "db://oops-framework/core/Oops";
- import VMParent from "db://oops-framework/libs/model-view/VMParent";
- import { AD_TYPE } from "../common/config/GameDefine";
- import { UIID } from "../common/config/GameUIConfig";
- import { ADHandler } from "../common/manager/ADHandler";
- import { smc } from "../common/SingletonModuleComp";
- import { GameEvent } from "../common/config/GameEvent";
- import { DCHandler } from "../common/manager/DCHandler";
- const { ccclass, property } = _decorator;
- /** 视图层对象 */
- @ccclass('DoubleSpeedViewComp')
- export class DoubleSpeedViewComp extends VMParent {
- /** 视图层逻辑代码分离演示 */
- data: any = {
- time: 0,
- }
- start() {
- // const entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
- DCHandler.inst.reportData(3000300);
- this.setButton();
- this.data.time = smc.game.GameModel.doubleSpeedTime / 60;
- }
- private btn_open() {
- this.openAd();
- oops.gui.remove(UIID.DoubleSpeed);
- }
- //打开广告
- private openAd() {
- smc.game.GameModel.viewType = "speed_reward";
- ADHandler.inst.showAd(AD_TYPE.Double_Speed_Receive);
- oops.message.dispatchEvent(GameEvent.updateGameState, "paused");
- DCHandler.inst.reportData(3000301);
- }
- private btn_no() {
- oops.gui.remove(UIID.DoubleSpeed);
- ADHandler.inst.showAd("107");
- oops.message.dispatchEvent(GameEvent.updateGameState, "paused");
- DCHandler.inst.reportData(3000302);
- }
- private btn_close() {
- oops.gui.remove(UIID.DoubleSpeed);
- //播放插屏广告
- ADHandler.inst.showAd("107");
- oops.message.dispatchEvent(GameEvent.updateGameState, "paused");
- DCHandler.inst.reportData(3000302);
- }
- }
|