Quellcode durchsuchen

优先判断胜利

woso_javan vor 3 Monaten
Ursprung
Commit
2872782de9

+ 12 - 12
assets/module_take_goblet/Prefabs/UI/Result/UI_BattleResult.prefab

@@ -1169,8 +1169,8 @@
     },
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": -344,
-      "y": 0,
+      "x": -350,
+      "y": 3.773,
       "z": 0
     },
     "_lrot": {
@@ -1210,8 +1210,8 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 0,
-      "height": 75
+      "width": 700,
+      "height": 80
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -1306,7 +1306,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 0,
-      "y": 0,
+      "y": 5,
       "z": 0
     },
     "_lrot": {
@@ -1533,8 +1533,8 @@
       "__id__": 49
     },
     "_mode": 0,
-    "_totalLength": 690,
-    "_progress": 0,
+    "_totalLength": 700,
+    "_progress": 1,
     "_reverse": false,
     "_id": ""
   },
@@ -3300,7 +3300,7 @@
     },
     "_lpos": {
       "__type__": "cc.Vec3",
-      "x": -344,
+      "x": -350,
       "y": 5,
       "z": 0
     },
@@ -3341,7 +3341,7 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 690,
+      "width": 350,
       "height": 75
     },
     "_anchorPoint": {
@@ -3437,7 +3437,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 0,
-      "y": 0,
+      "y": 5,
       "z": 0
     },
     "_lrot": {
@@ -3664,8 +3664,8 @@
       "__id__": 139
     },
     "_mode": 0,
-    "_totalLength": 690,
-    "_progress": 1,
+    "_totalLength": 700,
+    "_progress": 0.5,
     "_reverse": false,
     "_id": ""
   },

+ 10 - 5
assets/module_take_goblet/Script/LevelAction.ts

@@ -308,6 +308,11 @@ export class LevelAction extends Component {
                 originCup.hideCurrentWaterLayer();
             }
 
+            this.checkGameOver();
+
+            const { isEnd } = LevelManager.instance.levelModel;
+            if (isEnd) return;
+
             // 处理完所有颜色后检查剩余水层
             if (!originCup.waters) return
             const remaining = originCup.waters.children.filter(n => n.active).length;
@@ -429,7 +434,6 @@ export class LevelAction extends Component {
 
     //游戏检测胜利或失败
     checkGameOver() {
-        if (this.isProcessing) return;
         // 胜利条件检测:当两个区域都没有杯子时触发胜利
         if (this.outArea.getCups().length === 0 && this.waitArea.cups.length === 0) {
             this.loadResultPanel(true);
@@ -445,6 +449,7 @@ export class LevelAction extends Component {
     //加载结算面板
     loadResultPanel(win: boolean) {
         this.isProcessing = true;
+        LevelManager.instance.levelModel.isEnd = true;
         if (!win) {
             const waitLength = this.waitArea!.getCups().length;
             const outLength = this.outArea!.getCups().length;
@@ -475,17 +480,17 @@ export class LevelAction extends Component {
         const targetWorldPos = target.getWorldPosition().clone();
         const tempRegex = /TempCup/.test(origin.name);
 
-        let targetPosY: number = 135;
+        let targetPosY: number = 150;
         if (origin.getComponent(OriginCup)) {
             const targetCup = origin.getComponent(OriginCup)!;
             if (targetCup.cupHeight == CupHeight.Two) {
-                targetPosY = 165;
+                targetPosY = 180;
             } else if (targetCup.cupHeight == CupHeight.Four) {
-                targetPosY = 105;
+                targetPosY = 120;
             }
         }
         // 调整偏移量
-        targetWorldPos.x -= !tempRegex ? 55 : 40;
+        targetWorldPos.x -= !tempRegex ? 45 : 40;
         targetWorldPos.y += !tempRegex ? targetPosY : 205;
 
         // 移动动画到目标位置

+ 2 - 2
assets/module_take_goblet/rooster_takegoblet.scene

@@ -1646,7 +1646,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": -300,
-      "y": 580,
+      "y": 648.935,
       "z": 0
     },
     "_lrot": {
@@ -2036,7 +2036,7 @@
     "_target": null,
     "_left": 10,
     "_right": 0,
-    "_top": 10,
+    "_top": -58.934999999999945,
     "_bottom": 0,
     "_horizontalCenter": 0,
     "_verticalCenter": 0,