Explorar o código

【优化】修改翻倍奖励展示逻辑

mojunshou hai 7 meses
pai
achega
b1679e5205

+ 3 - 3
assets/bundle/gui/eliminate/prefab/doubleRewards.prefab

@@ -2587,7 +2587,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 516,
-      "height": 23
+      "height": 22
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -2635,7 +2635,7 @@
       "y": 0
     },
     "_fillStart": 0,
-    "_fillRange": 0.7,
+    "_fillRange": 1,
     "_isTrimmedMode": true,
     "_useGrayscale": false,
     "_atlas": null,
@@ -2748,7 +2748,7 @@
     },
     "_mode": 2,
     "_totalLength": 1,
-    "_progress": 0.7,
+    "_progress": 1,
     "_reverse": false,
     "_id": ""
   },

+ 2 - 2
assets/bundle/gui/eliminate/texture/tips_bg.png.meta

@@ -51,8 +51,8 @@
         "rawHeight": 60,
         "borderTop": 0,
         "borderBottom": 0,
-        "borderLeft": 0,
-        "borderRight": 0,
+        "borderLeft": 63,
+        "borderRight": 55,
         "packable": true,
         "pixelsToUnit": 100,
         "pivotX": 0.5,

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

@@ -2,7 +2,7 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-04-07 10:17:16
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-04-29 18:52:06
+ * @LastEditTime: 2025-04-30 15:02:14
  * @Description: 消息定义
  */
 

+ 2 - 2
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-29 18:34:18
+ * @LastEditTime: 2025-04-30 12:06:15
  * @Description: 惊喜翻倍弹窗
  */
 import { _decorator, instantiate, Label, Node, Prefab, UITransform } from 'cc';
@@ -158,7 +158,7 @@ export class DoubleRewardsView extends VMParent {
                     //可以通过除,如果大于0.5就右边一点小于就左边一点,中间就在中间
                     //x轴位置,-60, 0,60;
                     if (this.data.curGoldNum / this.data.handlingCharge > 0.5) {
-                        this.tipsLabelNode.setPosition(60, this.tipsLabelNode.position.y);
+                        this.tipsLabelNode.setPosition(50, this.tipsLabelNode.position.y);
                     } else if (this.data.curGoldNum / this.data.handlingCharge < 0.5) {
                         this.tipsLabelNode.setPosition(-80, this.tipsLabelNode.position.y);
                     } else {

+ 11 - 4
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-30 10:32:04
+ * @LastEditTime: 2025-04-30 15:42:36
  * @Description: 消除游戏主场景
  */
 import { _decorator, Button, Color, EventTouch, instantiate, JsonAsset, Animation, v3, Label, Node, Prefab, randomRangeInt, Sprite, tween, UITransform, Vec2, Vec3, Widget } from "cc";
@@ -1600,12 +1600,19 @@ export class EliminateViewComp extends CCComp {
                                 if (this.eliminateTotal % randomNum === 0) {
                                     //如果有自动就暂停自动
                                     if (smc.game.GameModel.skipAdConfig != -1) {
-                                        if (smc.game.GameModel.skipAdCount == 0 || smc.game.GameModel.skipAdCount % smc.game.GameModel.skipAdConfig != 0) {
-                                            ServerHandler.inst.getDoubleSurprise();
-                                        } else {
+                                        //大于就直接看视频
+                                        if (smc.game.GameModel.skipAdCount > smc.game.GameModel.skipAdConfig) {
                                             smc.game.GameModel.viewType = "double_reward";
                                             smc.game.GameModel.directAdCount++; //测试看
                                             ADHandler.inst.showAd(AD_TYPE.Double_Receive);
+                                        } else {
+                                            if (smc.game.GameModel.skipAdCount == 0 || smc.game.GameModel.skipAdCount % smc.game.GameModel.skipAdConfig != 0) {
+                                                ServerHandler.inst.getDoubleSurprise();
+                                            } else {
+                                                smc.game.GameModel.viewType = "double_reward";
+                                                smc.game.GameModel.directAdCount++; //测试看
+                                                ADHandler.inst.showAd(AD_TYPE.Double_Receive);
+                                            }
                                         }
                                     } else {
                                         ServerHandler.inst.getDoubleSurprise();