Jelajahi Sumber

【功能】完成打点预埋

mojunshou 7 bulan lalu
induk
melakukan
990ff905f7

+ 127 - 12
assets/bundle/gui/eliminate/eliminate.prefab

@@ -28,17 +28,17 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 427
+        "__id__": 433
       },
       {
-        "__id__": 429
+        "__id__": 435
       },
       {
-        "__id__": 431
+        "__id__": 437
       }
     ],
     "_prefab": {
-      "__id__": 433
+      "__id__": 439
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -270,19 +270,22 @@
       },
       {
         "__id__": 418
+      },
+      {
+        "__id__": 422
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 422
+        "__id__": 428
       },
       {
-        "__id__": 424
+        "__id__": 430
       }
     ],
     "_prefab": {
-      "__id__": 426
+      "__id__": 432
     },
     "_lpos": {
       "__type__": "cc.Vec3",
@@ -10247,6 +10250,115 @@
     "nestedPrefabInstanceRoots": null
   },
   {
+    "__type__": "cc.Node",
+    "_name": "autoNode",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "_parent": {
+      "__id__": 10
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 423
+      },
+      {
+        "__id__": 425
+      }
+    ],
+    "_prefab": {
+      "__id__": 427
+    },
+    "_lpos": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": -28.903,
+      "z": 0
+    },
+    "_lrot": {
+      "__type__": "cc.Quat",
+      "x": 0,
+      "y": 0,
+      "z": 0,
+      "w": 1
+    },
+    "_lscale": {
+      "__type__": "cc.Vec3",
+      "x": 1,
+      "y": 1,
+      "z": 1
+    },
+    "_mobility": 0,
+    "_layer": 33554432,
+    "_euler": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.UITransform",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 422
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 424
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 720,
+      "height": 1050
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "c2R/l+swVJ+70CFVuyhki1"
+  },
+  {
+    "__type__": "cc.BlockInputEvents",
+    "_name": "",
+    "_objFlags": 0,
+    "__editorExtras__": {},
+    "node": {
+      "__id__": 422
+    },
+    "_enabled": true,
+    "__prefab": {
+      "__id__": 426
+    },
+    "_id": ""
+  },
+  {
+    "__type__": "cc.CompPrefabInfo",
+    "fileId": "4c6ukhowlGO4TEAO+7HVRv"
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "ebB9NaoJtBy7EY4qM2+2/m",
+    "instance": null,
+    "targetOverrides": null,
+    "nestedPrefabInstanceRoots": null
+  },
+  {
     "__type__": "cc.UITransform",
     "_name": "",
     "_objFlags": 0,
@@ -10256,7 +10368,7 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 423
+      "__id__": 429
     },
     "_contentSize": {
       "__type__": "cc.Size",
@@ -10284,7 +10396,7 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 425
+      "__id__": 431
     },
     "_alignFlags": 45,
     "_target": null,
@@ -10333,7 +10445,7 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 428
+      "__id__": 434
     },
     "_contentSize": {
       "__type__": "cc.Size",
@@ -10361,7 +10473,7 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 430
+      "__id__": 436
     },
     "lab_wxCoin": {
       "__id__": 41
@@ -10483,6 +10595,9 @@
     "comboNode": {
       "__id__": 282
     },
+    "autoNode": {
+      "__id__": 422
+    },
     "_id": ""
   },
   {
@@ -10499,7 +10614,7 @@
     },
     "_enabled": true,
     "__prefab": {
-      "__id__": 432
+      "__id__": 438
     },
     "_alignFlags": 45,
     "_target": null,

+ 1 - 1
assets/script/game/common/manager/DCHandler.ts

@@ -26,7 +26,7 @@ export class DCHandler {
         }
 
         const data = {
-            method: 'analysis.event',
+            method: 'analytics.event',
             param: JSON.stringify(param)
         };
         const result = await CocosHandler.inst.sendMessageToAndroid(data, '获取数据上报状态');

+ 4 - 1
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-23 17:29:41
+ * @LastEditTime: 2025-04-23 18:57:46
  * @Description: 
  */
 // ServerHandler.ts
@@ -11,6 +11,7 @@ import { GameEvent } from '../config/GameEvent';
 import { oops } from 'db://oops-framework/core/Oops';
 import { CocosHandler, CocosHandlerType } from './CocosHandler';
 import { ProtocolEvent } from './ProtocolEvent';
+import { DCHandler } from './DCHandler';
 
 export class ServerHandler {
     private static _inst: ServerHandler;
@@ -452,6 +453,8 @@ export class ServerHandler {
         smc.game.GameModel.txNum = result.changes["8001"];
         smc.game.GameModel.txType = 1;
         oops.message.dispatchEvent(GameEvent.openView, "openCashWithdrawalView")
+        const curLevel = smc.account.AccountModel.curLevel;
+        DCHandler.inst.reportData(3000101, curLevel);
     }
 
 

+ 0 - 3
assets/script/game/view/CashWithdrawalView.ts

@@ -36,14 +36,11 @@ export class CashWithdrawalView extends GameComponent {
     private loadProgressBar: ProgressBar = null!;
 
     protected start() {
-        DCHandler.inst.reportData(3000700);
         this.setButton();
         this.setData();
     }
 
     setData() {
-        const curLevel = smc.account.AccountModel.curLevel;
-        DCHandler.inst.reportData(3000101, curLevel);
         this.mainNode.active = false;
         this.loadNode.active = false;
         const num = smc.game.GameModel.txNum;

+ 19 - 8
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-23 16:45:39
+ * @LastEditTime: 2025-04-23 19:03:04
  * @Description: 消除游戏主场景
  */
 import { _decorator, Button, Color, EventTouch, instantiate, JsonAsset, Label, Node, Prefab, randomRangeInt, Sprite, tween, UITransform, Vec2, Vec3, Widget } from "cc";
@@ -138,6 +138,9 @@ export class EliminateViewComp extends CCComp {
     @property({ type: Node, displayName: "ComboNode" })
     private comboNode: Node = null!;
 
+    @property({ type: Node, displayName: "自动放置Node拦截事件" })
+    private autoNode: Node = null!;
+
 
     //游戏配置行列
     private rows: number = 8;       // 行数
@@ -247,9 +250,7 @@ export class EliminateViewComp extends CCComp {
         }
         //更新福利点
         this.updateWelfarePoint();
-
         DCHandler.inst.reportData(3000005);
-
     }
 
 
@@ -316,6 +317,7 @@ export class EliminateViewComp extends CCComp {
         this.operateFlag = true
         this.shouldResetEliminateCount = true;
         this.currentCombo = 0;
+        this.autoNode.active = false;
     }
 
     //设置数据
@@ -337,6 +339,9 @@ export class EliminateViewComp extends CCComp {
         this.lab_goldNum.string = `${num + 1}`;
         this.gameState = GameState.PLAYING;
         this.randomList = this.getRandomUniqueInts();
+
+        const curLevel = smc.account.AccountModel.curLevel;
+        DCHandler.inst.reportData(3000500, curLevel);
     }
 
     updateCoin() {
@@ -918,7 +923,7 @@ export class EliminateViewComp extends CCComp {
         // 触摸开始事件
         brickNode.on(Node.EventType.TOUCH_START, (event: EventTouch) => {
             // 如果正在编辑其他方块,则忽略
-            if (!this.operateFlag) return;
+            if (!this.operateFlag && this.autoState) return;
             // 清空编辑中的数据
             this.editingData.brickData = null;
             this.editingData.gridList.length = 0;
@@ -942,7 +947,7 @@ export class EliminateViewComp extends CCComp {
 
         // 触摸移动事件
         brickNode.on(Node.EventType.TOUCH_MOVE, (event: EventTouch) => {
-            if (!this.operateFlag) return;
+            if (!this.operateFlag && this.autoState) return;
 
             const movePos: Vec2 = event.getUILocation().subtract(this.touchStartPos)
             // 挪动很小时,不移动方块组合
@@ -1012,10 +1017,9 @@ export class EliminateViewComp extends CCComp {
                 }
             });
         }, this);
-
         // 触摸结束或取消事件
         const touchEndHandler = (event: EventTouch) => {
-
+            if (this.autoState) return;
             if (this.adShowingFlag || !this.operateFlag) return
             this.operateFlag = false
             // 单击旋转
@@ -1842,6 +1846,8 @@ export class EliminateViewComp extends CCComp {
             this.initButtonState(false);
             this.autoState = false;
         }
+        const curLevel = smc.account.AccountModel.curLevel;
+        DCHandler.inst.reportData(3000501, curLevel);
     }
 
 
@@ -1955,6 +1961,7 @@ export class EliminateViewComp extends CCComp {
             this.executeAutoPlace();
             this.autoFunction = this.executeAutoPlace;
             this.schedule(this.autoFunction, 1.5);
+            this.autoNode.active = true;
         } else {
             //关闭
             if (this.autoFunction) {
@@ -1963,6 +1970,7 @@ export class EliminateViewComp extends CCComp {
                 this.autoFunction = null;
                 this.initButtonState(false);
                 this.autoState = false;
+                this.autoNode.active = false;
             }
         }
     }
@@ -2175,7 +2183,7 @@ export class EliminateViewComp extends CCComp {
             this.initButtonState(this.autoState);
         }
         this.callback = function () {
-            if (!this.adShowingFlag && this.gameState === GameState.PLAYING) {
+            if (!this.adShowingFlag && this.gameState === GameState.PLAYING && this.autoState) {
                 this.doubleSpeedTime--
                 //修改剩余时间,秒格式化成时分10:59
                 const minutes = Math.floor(this.doubleSpeedTime / 60);
@@ -2193,6 +2201,9 @@ export class EliminateViewComp extends CCComp {
                     this.unschedule(this.callback);
                 }
             }
+            if (!this.autoState && this.doubleSpeedTime) {
+                this.lab_doubleTime.string = "二倍速";
+            }
         }
         this.schedule(this.callback, 1);
     }

+ 5 - 1
assets/script/game/view/GamePassView.ts

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-03-21 14:43:24
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-23 17:32:10
+ * @LastEditTime: 2025-04-23 18:59:11
  * @Description: 游戏通关弹窗
  */
 import { Label, Node } from 'cc';
@@ -60,6 +60,10 @@ export class GamePassView extends GameComponent {
 
 
     private setData() {
+        if (smc.game.GameModel.eventType) {
+            const curLevel = smc.account.AccountModel.curLevel;
+            DCHandler.inst.reportData(3000100, curLevel);
+        }
         this.isAuto = smc.game.GameModel.passViewInfo.doubleReward;
         this.receiveNode.active = this.isAuto;
         if (this.isAuto) {