Explorar el Código

【功能】添加跳过翻倍奖励页面直接播放广告功能

mojunshou hace 7 meses
padre
commit
7ab743515e

+ 113 - 113
assets/bundle/gui/eliminate/prefab/redPacketWithdrawal.prefab

@@ -23,6 +23,9 @@
       },
       {
         "__id__": 10
+      },
+      {
+        "__id__": 212
       }
     ],
     "_active": true,
@@ -261,22 +264,19 @@
       },
       {
         "__id__": 141
-      },
-      {
-        "__id__": 207
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 221
+        "__id__": 207
       },
       {
-        "__id__": 223
+        "__id__": 209
       }
     ],
     "_prefab": {
-      "__id__": 225
+      "__id__": 211
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -4899,37 +4899,114 @@
     "nestedPrefabInstanceRoots": null
   },
   {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 10
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 208
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 720,
+      "height": 1600
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "aaV1UOPdtBabGghMJVF4ER"
+  },
+  {
+    "__type__": "cc.Widget",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 10
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 210
+    },
+    "_alignFlags": 45,
+    "_target": null,
+    "_left": 0,
+    "_right": 0,
+    "_top": 0,
+    "_bottom": 0,
+    "_horizontalCenter": 0,
+    "_verticalCenter": 0,
+    "_isAbsLeft": true,
+    "_isAbsRight": true,
+    "_isAbsTop": true,
+    "_isAbsBottom": true,
+    "_isAbsHorizontalCenter": true,
+    "_isAbsVerticalCenter": true,
+    "_originalWidth": 100,
+    "_originalHeight": 100,
+    "_alignMode": 2,
+    "_lockFlags": 0,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "c49XmOaANOoIh4ti5veCTP"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "feDOG3rjNOfqGW58diXcVX",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
     "__type__": "cc.Node",
     "_name": "btn_text",
     "_objFlags": 0,
     "__editorExtras__": {},
     "_parent": {
-      "__id__": 10
+      "__id__": 1
     },
     "_children": [
       {
-        "__id__": 208
+        "__id__": 213
       }
     ],
-    "_active": false,
+    "_active": true,
     "_components": [
       {
-        "__id__": 214
+        "__id__": 219
       },
       {
-        "__id__": 216
+        "__id__": 221
       },
       {
-        "__id__": 218
+        "__id__": 223
       }
     ],
     "_prefab": {
-      "__id__": 220
+      "__id__": 225
     },
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 0,
-      "y": 320.505,
+      "y": 305.722,
       "z": 0
     },
     "_lrot": {
@@ -4961,20 +5038,20 @@
     "_objFlags": 512,
     "__editorExtras__": {},
     "_parent": {
-      "__id__": 207
+      "__id__": 212
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 209
+        "__id__": 214
       },
       {
-        "__id__": 211
+        "__id__": 216
       }
     ],
     "_prefab": {
-      "__id__": 213
+      "__id__": 218
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -5011,11 +5088,11 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 208
+      "__id__": 213
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 210
+      "__id__": 215
     },
     "_contentSize": {
       "__type__": "cc.Size",
@@ -5031,7 +5108,7 @@
   },
   {
     "__type__": "cc.CompPrefabInfo",
-    "fileId": "19CBcCqVVHAp+eTu1iLNAm"
+    "fileId": "accfjWD/9MyJjyVKxlMF+F"
   },
   {
     "__type__": "cc.Label",
@@ -5039,11 +5116,11 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 208
+      "__id__": 213
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 212
+      "__id__": 217
     },
     "_customMaterial": null,
     "_srcBlendFactor": 2,
@@ -5099,7 +5176,7 @@
   },
   {
     "__type__": "cc.CompPrefabInfo",
-    "fileId": "85urXghKFB0K5sxAu4KDOR"
+    "fileId": "ddu06cwDBNAqu1vKlGO7WS"
   },
   {
     "__type__": "cc.PrefabInfo",
@@ -5109,7 +5186,7 @@
     "asset": {
       "__id__": 0
     },
-    "fileId": "f971/oOdBGpqpnrAYdqolV",
+    "fileId": "96UEeyTsZNbqTpg9pWfGp6",
     "instance": null,
     "targetOverrides": null,
     "nestedPrefabInstanceRoots": null
@@ -5120,11 +5197,11 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 207
+      "__id__": 212
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 215
+      "__id__": 220
     },
     "_contentSize": {
       "__type__": "cc.Size",
@@ -5140,7 +5217,7 @@
   },
   {
     "__type__": "cc.CompPrefabInfo",
-    "fileId": "9fkJpIW9tAhYyeFnLtadxM"
+    "fileId": "92B8/uizRPzocEzcTXTYFL"
   },
   {
     "__type__": "cc.Sprite",
@@ -5148,11 +5225,11 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 207
+      "__id__": 212
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 217
+      "__id__": 222
     },
     "_customMaterial": null,
     "_srcBlendFactor": 2,
@@ -5185,7 +5262,7 @@
   },
   {
     "__type__": "cc.CompPrefabInfo",
-    "fileId": "345TMVJIVN8IVL2bZZw1Cg"
+    "fileId": "a08kjBfC1BzKUtVKUJSYyX"
   },
   {
     "__type__": "cc.Button",
@@ -5193,11 +5270,11 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 207
+      "__id__": 212
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 219
+      "__id__": 224
     },
     "clickEvents": [],
     "_interactable": true,
@@ -5249,90 +5326,13 @@
     "_duration": 0.1,
     "_zoomScale": 1.2,
     "_target": {
-      "__id__": 207
-    },
-    "_id": ""
-  },
-  {
-    "__type__": "cc.CompPrefabInfo",
-    "fileId": "05CL11Ue5LF6nyjMM6EHkN"
-  },
-  {
-    "__type__": "cc.PrefabInfo",
-    "root": {
-      "__id__": 1
-    },
-    "asset": {
-      "__id__": 0
-    },
-    "fileId": "8dr65IknpNCqFDGOFeZgqH",
-    "instance": null,
-    "targetOverrides": null,
-    "nestedPrefabInstanceRoots": null
-  },
-  {
-    "__type__": "cc.UITransform",
-    "_name": "",
-    "_objFlags": 0,
-    "__editorExtras__": {},
-    "node": {
-      "__id__": 10
-    },
-    "_enabled": true,
-    "__prefab": {
-      "__id__": 222
-    },
-    "_contentSize": {
-      "__type__": "cc.Size",
-      "width": 720,
-      "height": 1600
-    },
-    "_anchorPoint": {
-      "__type__": "cc.Vec2",
-      "x": 0.5,
-      "y": 0.5
-    },
-    "_id": ""
-  },
-  {
-    "__type__": "cc.CompPrefabInfo",
-    "fileId": "aaV1UOPdtBabGghMJVF4ER"
-  },
-  {
-    "__type__": "cc.Widget",
-    "_name": "",
-    "_objFlags": 0,
-    "__editorExtras__": {},
-    "node": {
-      "__id__": 10
-    },
-    "_enabled": true,
-    "__prefab": {
-      "__id__": 224
+      "__id__": 212
     },
-    "_alignFlags": 45,
-    "_target": null,
-    "_left": 0,
-    "_right": 0,
-    "_top": 0,
-    "_bottom": 0,
-    "_horizontalCenter": 0,
-    "_verticalCenter": 0,
-    "_isAbsLeft": true,
-    "_isAbsRight": true,
-    "_isAbsTop": true,
-    "_isAbsBottom": true,
-    "_isAbsHorizontalCenter": true,
-    "_isAbsVerticalCenter": true,
-    "_originalWidth": 100,
-    "_originalHeight": 100,
-    "_alignMode": 2,
-    "_lockFlags": 0,
     "_id": ""
   },
   {
     "__type__": "cc.CompPrefabInfo",
-    "fileId": "c49XmOaANOoIh4ti5veCTP"
+    "fileId": "1cjl+TLcBDRrzOLi6Lh+3Q"
   },
   {
     "__type__": "cc.PrefabInfo",
@@ -5342,7 +5342,7 @@
     "asset": {
       "__id__": 0
     },
-    "fileId": "feDOG3rjNOfqGW58diXcVX",
+    "fileId": "c1fOXDF5hI1q4VodXHsvIG",
     "instance": null,
     "targetOverrides": null,
     "nestedPrefabInstanceRoots": null

+ 2 - 6
assets/script/game/common/manager/ADHandler.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-04-11 10:14:44
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-24 18:23:19
+ * @LastEditTime: 2025-04-25 10:00:57
  * @Description: 
  */
 // ADHandler.ts
@@ -26,7 +26,6 @@ export class ADHandler {
     }
 
     showAd = async (id: string) => {
-        oops.gui.waitOpen();
         smc.game.GameModel.isShowAd = true;
         const { method, param } = this.buildAdParam(id);
         const data: CocosHandlerType = {
@@ -64,6 +63,7 @@ export class ADHandler {
                 param.callback.onClose = 'ADHandler.inst.adInterstitialClose';
                 break;
             default:
+                oops.gui.waitOpen();
                 method = 'ad.reward';
                 param.callback.onShow = 'ADHandler.inst.adRewardShow';
                 param.callback.onClose = 'ADHandler.inst.adRewardClose';
@@ -75,7 +75,6 @@ export class ADHandler {
     //启屏广告关闭
     adSplashClose = async () => {
         console.log("启屏广告关闭")
-        oops.gui.waitClose();
         smc.game.GameModel.isShowAd = false;
         if (oops.gui.has(UIID.KindTips)) oops.gui.remove(UIID.KindTips);
         if (oops.gui.has(UIID.Retention)) oops.gui.remove(UIID.Retention);
@@ -94,14 +93,11 @@ export class ADHandler {
     };
 
     adInterstitialLoadFailed = () => {
-        console.log("000000")
-        oops.gui.waitClose();
         console.log('[广告] 插屏广告加载失败');
         oops.message.dispatchEvent(GameEvent.updateGameState, "playing");
     };
 
     adInterstitialClose = (type: boolean) => {
-        oops.gui.waitClose();
         smc.game.GameModel.isShowAd = false;
         console.log('[广告] 插屏广告关闭', type);
         //如果有弹窗,则不发送事件,

+ 5 - 5
assets/script/game/common/manager/ServerHandler.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-04-11 10:16:41
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-24 17:42:18
+ * @LastEditTime: 2025-04-25 11:08:49
  * @Description: 
  */
 // ServerHandler.ts
@@ -84,8 +84,8 @@ export class ServerHandler {
         account.wxCoin = data.props['1005'];
         account.hbCoin = data.props['1004'];
         account.goldCoin = data.props['1006'];
-        console.log("account.goldCoin", account.goldCoin)
         game.popupShow = data.currentLevelInfo.popupStatus
+        game.skipAdConfig = data.currentLevelConf.skipCount || -1;
         oops.message.dispatchEvent(GameEvent.UserLogin);
     }
 
@@ -410,7 +410,8 @@ export class ServerHandler {
         smc.game.GameModel.curLevelConfig = result.currentLevelConf;
         smc.account.AccountModel.goldCoin = result.props["1006"] //金砖数量
         smc.game.GameModel.popupType = result.currentLevelConf.popupType || "";
-        smc.game.GameModel.popupShow = result.currentLevelData.popupStatus
+        smc.game.GameModel.popupShow = result.currentLevelData.popupStatus;
+        smc.game.GameModel.skipAdConfig = result.currentLevelConf.skipCount || -1;
         oops.message.dispatchEvent(GameEvent.RestartGame);
     }
 
@@ -479,11 +480,10 @@ export class ServerHandler {
         const wxCash = result.changes["8001"];
         smc.game.GameModel.txNum = wxCash;
         smc.game.GameModel.txType = 2;
-        oops.message.dispatchEvent(GameEvent.openView, "openCashWithdrawalView");
-        //更新红包页面的数值
         smc.account.AccountModel.hbCoin = result.props["1004"];
         smc.account.AccountModel.wxCoin = result.props["1005"];
         smc.game.GameModel.wxCash = result.money || 0;
+        oops.message.dispatchEvent(GameEvent.openView, "openCashWithdrawalView");
         oops.message.dispatchEvent(GameEvent.updateHbAndWxCoin);
     }
 

+ 24 - 0
assets/script/game/model/GameModelComp.ts

@@ -176,6 +176,11 @@ export class GameModelComp extends ecs.Comp {
 
     _gameState: GameState = GameState.READY;
 
+    //广告跳过次数
+    _skipAdCount: number = 0;
+
+    //广告跳过次数配置
+    _skipAdConfig: number = -1;
     /** 数据层组件移除时,重置所有数据为默认值 */
     reset() {
         this.id = -1;
@@ -185,6 +190,25 @@ export class GameModelComp extends ecs.Comp {
         this.costInfo = null!;
     }
 
+    set skipAdCount(v: number) {
+        this._skipAdCount = v;
+    }
+
+    get skipAdCount() {
+        return this._skipAdCount;
+    }
+
+
+    set skipAdConfig(v: number) {
+        this._skipAdConfig = v;
+    }
+
+    get skipAdConfig() {
+        return this._skipAdConfig;
+    }
+
+
+
     set gameState(v: GameState) {
         this._gameState = v;
     }

+ 2 - 1
assets/script/game/view/DoubleRewardsView.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-03-21 11:57:43
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-24 15:27:45
+ * @LastEditTime: 2025-04-25 11:10:04
  * @Description: 惊喜翻倍弹窗
  */
 import { _decorator, instantiate, Label, Node, Prefab, UITransform } from 'cc';
@@ -84,6 +84,7 @@ export class DoubleRewardsView extends VMParent {
         ADHandler.inst.showAd(AD_TYPE.Double_Close);
         DCHandler.inst.reportData(2000401);
         DCHandler.inst.reportData(2000403);
+        smc.game.GameModel.skipAdCount++;
     }
 
 

+ 29 - 60
assets/script/game/view/EliminateViewComp.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-03-20 15:01:09
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-24 18:11:32
+ * @LastEditTime: 2025-04-25 11:12:46
  * @Description: 消除游戏主场景
  */
 import { _decorator, Button, Color, EventTouch, instantiate, JsonAsset, v3, Label, Node, Prefab, randomRangeInt, Sprite, tween, UITransform, Vec2, Vec3, Widget } from "cc";
@@ -18,6 +18,8 @@ import { smc } from "../common/SingletonModuleComp";
 import { Format } from "../utils/Format";
 import { DCHandler } from "../common/manager/DCHandler";
 import { Tween } from "cc";
+import { AD_TYPE } from "../common/config/GameDefine";
+import { ADHandler } from "../common/manager/ADHandler";
 
 const { ccclass, property } = _decorator;
 
@@ -485,16 +487,15 @@ export class EliminateViewComp extends CCComp {
             type: colorIndex,
             rotateNode: new Node(),
         }
-        console.log("brickKey>>>>>>>>>>", brickKey, colorIndex)
-        const node = this.generateBrick(brickKey, colorIndex)
-
-
+        const node = this.generateBrick(brickKey, colorIndex);
         this.brickNode.addChild(node);
         const transform = this.brickNode.getComponent(UITransform);
         if (transform) {
             const midX = transform.width / 2;
             node.setPosition(0, 0);
             brickData.brickNode = node
+            brickData.brickNode.scale_x = 0.6;
+            brickData.brickNode.scale_y = 0.6;
             brickData.brickInitPos = node.getWorldPosition()
             this.bricksList.push(brickData)
             this.brickAddEvent(brickData)
@@ -1125,7 +1126,7 @@ export class EliminateViewComp extends CCComp {
         }, this);
         // 触摸结束或取消事件
         const touchEndHandler = (event: EventTouch) => {
-            if (this.adShowingFlag || !this.operateFlag) return
+            if (!this.operateFlag) return
             this.operateFlag = false
             // 单击旋转
             if (!this.editingData.brickData) {
@@ -1195,7 +1196,7 @@ export class EliminateViewComp extends CCComp {
 
                     const simulateResult = this.gridEliminateCheck(tempGridList)
                     const canEliminate = simulateResult.gridEliminateList.length > 0
-
+                    //如果不能消除,则将方块返回原位置
                     if (!canEliminate) {
                         this.bricksList.push(brickData);
                         if (brickData.brickNode) {
@@ -1238,6 +1239,8 @@ export class EliminateViewComp extends CCComp {
                         centerPos.y /= validGridCount;
                     }
                 }
+                // 显示放置得分动画(显示一次,包含总格子数)
+                this.showScoreAnimation(centerPos, placedGridCount);
                 // 放置方块到网格
                 this.editingData.gridList.forEach(grid => {
                     grid.status = CellState.FILLED;
@@ -1245,16 +1248,9 @@ export class EliminateViewComp extends CCComp {
                     this.generateGrid(grid);
                 });
 
-                // 显示放置得分动画(显示一次,包含总格子数)
-                this.showScoreAnimation(centerPos, placedGridCount);
-                //这里要计算分数,并且计算能消除的分数,然后增加分,这才对
-
                 // 标记需要重置消除计数器
                 this.shouldResetEliminateCount = true;
-
-                // 销毁方块节点
                 brickNode.destroy();
-                // 添加新方块到待选区
                 this.addBrick(this.editingData.brickData.index);
 
                 // 检查消除
@@ -1264,7 +1260,6 @@ export class EliminateViewComp extends CCComp {
                         if (!hasElimination) {
                             this.shouldResetEliminateCount = true;
                         }
-
                         this.operateFlag = true;
                         //新手引导
                         if (this.isGuideMode) {
@@ -1280,7 +1275,6 @@ export class EliminateViewComp extends CCComp {
                                 }
                             }, 0.3)
                         } else {
-
                             // 检查游戏是否结束
                             this.prompt(false).then(canContinue => {
                                 if (!canContinue) {
@@ -1540,9 +1534,14 @@ export class EliminateViewComp extends CCComp {
                                 // oops.gui.open(UIID.DoubleSpeed);
                                 //如果有自动就暂停自动
                                 this.gameState = GameState.PAUSED;
-                                console.log("弹出翻倍广告");
-                                ServerHandler.inst.getDoubleSurprise();
-                                //弹出广告
+                                if (smc.game.GameModel.skipAdConfig != 1) {
+                                    if (smc.game.GameModel.skipAdCount % smc.game.GameModel.skipAdConfig == 0) {
+                                        smc.game.GameModel.viewType = "double_reward";
+                                        ADHandler.inst.showAd(AD_TYPE.Double_Receive);
+                                    } else {
+                                        ServerHandler.inst.getDoubleSurprise();
+                                    }
+                                }
                             }
                         }
                     }
@@ -1553,7 +1552,7 @@ export class EliminateViewComp extends CCComp {
         })
     }
 
-
+    //消除检查
     gridEliminateCheck(gridList: GridData[][]) {
         const gridEliminateList: GridData[] = []
         let eliminateRowNum = 0
@@ -1888,17 +1887,8 @@ export class EliminateViewComp extends CCComp {
 
     gameOver() {
         this.gameState = GameState.GAME_OVER
-        this.setGameState(GameState.GAME_OVER)
-        console.log("游戏结束")
         smc.game.GameModel.curScore = this.score;
         oops.gui.open(UIID.GameOver);
-        //如果有自动就要关闭自动
-        if (this.autoFunction) {
-            this.unschedule(this.autoFunction);
-            this.autoFunction = null;
-            this.initButtonState(false);
-            this.autoState = false;
-        }
         const curLevel = smc.account.AccountModel.curLevel;
         DCHandler.inst.reportData(3000501, curLevel);
     }
@@ -1909,7 +1899,6 @@ export class EliminateViewComp extends CCComp {
         this.lab_score.string = this.score.toString();
         if (this.score >= this.targetScore) {
             this.gameState = GameState.GAME_PASS;
-            this.setGameState(this.gameState);
             //弹出通关奖励界面
             if (DeviceUtil.isNative && DeviceUtil.isAndroid) {
                 ServerHandler.inst.getGameAwardInfo();
@@ -1931,25 +1920,6 @@ export class EliminateViewComp extends CCComp {
         children.forEach(node => node.destroy());
     }
 
-    private setGameState(state: GameState) {
-        this.gameState = state;
-        switch (state) {
-            case GameState.READY:
-                break;
-            case GameState.PLAYING:
-                break;
-            case GameState.PAUSED:
-                break;
-            case GameState.GAME_OVER:
-                //打开游戏结束界面
-                this.autoState = false;
-                this.adShowingFlag = false;
-                //自动按钮改为手动 
-                this.initButtonState(false);
-                break;
-        }
-    }
-
 
     //========================打开其他界面和按钮逻辑=======================
 
@@ -1968,29 +1938,26 @@ export class EliminateViewComp extends CCComp {
     //左边微信按钮
     private btn_withdraw() {
         if (DeviceUtil.isNative && DeviceUtil.isAndroid) {
+            this.gameState = GameState.PAUSED;
             ServerHandler.inst.getWechatTxInfo();
             DCHandler.inst.reportData(3000006);
         } else {
             oops.gui.open(UIID.WechatWithdraw);
         }
-        this.gameState = GameState.PAUSED;
-
     }
 
     //顶部红包按钮
     private btn_award() {
-        //oops.gui.open(UIID.RedPacketWithdraw);
-
         if (DeviceUtil.isNative && DeviceUtil.isAndroid) {
+            this.gameState = GameState.PAUSED;
             ServerHandler.inst.getHbTxInfo();
             DCHandler.inst.reportData(3000007);
         } else {
             oops.gui.open(UIID.RedPacketWithdraw);
         }
-        this.gameState = GameState.PAUSED;
     }
 
-    //二倍速按钮   
+    //二倍速按钮继续   
     private btn_double() {
         // oops.gui.open(UIID.DoubleSpeed);
         if (DeviceUtil.isNative && DeviceUtil.isAndroid) {
@@ -2003,7 +1970,7 @@ export class EliminateViewComp extends CCComp {
     }
 
 
-    //自动放置
+    //自动放置,不让点击方块
     private btn_auto() {
         this.autoState = !this.autoState;
         this.initButtonState(this.autoState);
@@ -2017,6 +1984,7 @@ export class EliminateViewComp extends CCComp {
             //关闭
             if (this.autoFunction) {
                 DCHandler.inst.reportData(3000009);
+                this.operateFlag = true;
                 this.unschedule(this.autoFunction);
                 this.autoFunction = null;
                 this.initButtonState(false);
@@ -2029,7 +1997,7 @@ export class EliminateViewComp extends CCComp {
 
     // 执行自动放置
     executeAutoPlace() {
-        if (!this.autoState || this.gameState !== GameState.PLAYING || this.adShowingFlag) {
+        if (!this.autoState || this.gameState !== GameState.PLAYING) {
             return
         }
         const bestPlacement = this.findBestPlacement()
@@ -2041,6 +2009,7 @@ export class EliminateViewComp extends CCComp {
             return
         }
         // 执行放置
+        this.operateFlag = false;
         this.placeBrickAtPosition(bestPlacement)
     }
 
@@ -2224,8 +2193,8 @@ export class EliminateViewComp extends CCComp {
         this.doubleNum = 2;
         //改变按钮时间
         // let time = smc.game.GameModel.doubleSpeedTime;
-        // this.doubleSpeedTime = this.doubleSpeedTime + smc.game.GameModel.doubleSpeedTime;
-        this.doubleSpeedTime = 20;
+        this.doubleSpeedTime = this.doubleSpeedTime + smc.game.GameModel.doubleSpeedTime;
+        // this.doubleSpeedTime = 60;
         if (this.doubleSpeedTime <= 0) {
             return
         }
@@ -2236,7 +2205,7 @@ export class EliminateViewComp extends CCComp {
             this.initButtonState(this.autoState);
         }
         this.callback = function () {
-            if (!this.adShowingFlag && this.gameState === GameState.PLAYING && this.autoState) {
+            if (this.gameState === GameState.PLAYING && this.autoState) {
                 this.doubleSpeedTime--
                 this.autoMoveTime = 0.25;
                 //修改剩余时间,秒格式化成时分10:59

+ 1 - 6
assets/script/game/view/RedPackeWithdrawalViewComp.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-03-20 17:53:50
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-24 19:10:25
+ * @LastEditTime: 2025-04-25 09:51:12
  * @Description: 红包提现
  */
 import { _decorator, Label, Node } from "cc";
@@ -129,10 +129,6 @@ export class RedPackeWithdrawalViewComp extends CCVMParentComp {
         this.node.destroy();
     }
 
-    formatNumber(num: number) {
-        return Math.round(num * 100) / 100;
-    }
-
 
     btn_text() {
         const info = {
@@ -155,5 +151,4 @@ export class RedPackeWithdrawalViewComp extends CCVMParentComp {
 
         ServerHandler.inst.onHbReward(JSON.stringify(info));
     }
-
 }