woso_javan il y a 3 mois
Parent
commit
989201ac01

+ 5 - 5
assets/module_take_goblet/Prefabs/Cup/Cocktail/CocktailThree.prefab

@@ -99,7 +99,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 0,
-      "y": 15,
+      "y": 0,
       "z": 0
     },
     "_lrot": {
@@ -570,7 +570,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 0,
-      "y": 15,
+      "y": 0,
       "z": 0
     },
     "_lrot": {
@@ -706,7 +706,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 0,
-      "y": 15,
+      "y": 0,
       "z": 0
     },
     "_lrot": {
@@ -842,7 +842,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 0,
-      "y": 15,
+      "y": 0,
       "z": 0
     },
     "_lrot": {
@@ -969,7 +969,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 100,
-      "height": 250
+      "height": 280
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",

+ 4 - 4
assets/module_take_goblet/Prefabs/Cup/Cocktail/CocktailTwo.prefab

@@ -96,7 +96,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 0,
-      "y": 30,
+      "y": 0,
       "z": 0
     },
     "_lrot": {
@@ -431,7 +431,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 0,
-      "y": 30,
+      "y": 0,
       "z": 0
     },
     "_lrot": {
@@ -567,7 +567,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 0,
-      "y": 30,
+      "y": 0,
       "z": 0
     },
     "_lrot": {
@@ -830,7 +830,7 @@
     "_contentSize": {
       "__type__": "cc.Size",
       "width": 100,
-      "height": 220
+      "height": 280
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",

+ 7 - 3
assets/module_take_goblet/Prefabs/Levels/lvl_2.prefab

@@ -1964,7 +1964,8 @@
     "fileId": "c46/YsCPVOJYA4mWEpNYRx",
     "instance": {
       "__id__": 94
-    }
+    },
+    "targetOverrides": null
   },
   {
     "__type__": "cc.PrefabInstance",
@@ -2136,7 +2137,8 @@
     "fileId": "c46/YsCPVOJYA4mWEpNYRx",
     "instance": {
       "__id__": 109
-    }
+    },
+    "targetOverrides": null
   },
   {
     "__type__": "cc.PrefabInstance",
@@ -4047,7 +4049,9 @@
     "waitArea": {
       "__id__": 30
     },
-    "tempCups": null,
+    "tempCups": {
+      "__id__": 69
+    },
     "originArea": {
       "__id__": 152
     },

+ 3 - 1
assets/module_take_goblet/Prefabs/Levels/lvl_3.prefab

@@ -4049,7 +4049,9 @@
     "waitArea": {
       "__id__": 30
     },
-    "tempCups": null,
+    "tempCups": {
+      "__id__": 69
+    },
     "originArea": {
       "__id__": 152
     },

+ 5 - 1
assets/module_take_goblet/Prefabs/Levels/lvl_4.prefab

@@ -3855,6 +3855,8 @@
       "__id__": 0
     },
     "fileId": "70trqmeoVP076jCagZ8QYj",
+    "instance": null,
+    "targetOverrides": null,
     "nestedPrefabInstanceRoots": null
   },
   {
@@ -3903,7 +3905,9 @@
     "waitArea": {
       "__id__": 30
     },
-    "tempCups": null,
+    "tempCups": {
+      "__id__": 69
+    },
     "originArea": {
       "__id__": 152
     },

+ 7 - 3
assets/module_take_goblet/Prefabs/Levels/lvl_5.prefab

@@ -2913,7 +2913,8 @@
     "fileId": "c46/YsCPVOJYA4mWEpNYRx",
     "instance": {
       "__id__": 164
-    }
+    },
+    "targetOverrides": []
   },
   {
     "__type__": "cc.PrefabInstance",
@@ -3326,7 +3327,8 @@
     "fileId": "c46/YsCPVOJYA4mWEpNYRx",
     "instance": {
       "__id__": 195
-    }
+    },
+    "targetOverrides": []
   },
   {
     "__type__": "cc.PrefabInstance",
@@ -3951,7 +3953,9 @@
     "waitArea": {
       "__id__": 30
     },
-    "tempCups": null,
+    "tempCups": {
+      "__id__": 69
+    },
     "originArea": {
       "__id__": 152
     },

+ 3 - 1
assets/module_take_goblet/Prefabs/Levels/lvl_6.prefab

@@ -3953,7 +3953,9 @@
     "waitArea": {
       "__id__": 30
     },
-    "tempCups": null,
+    "tempCups": {
+      "__id__": 69
+    },
     "originArea": {
       "__id__": 152
     },

+ 3 - 1
assets/module_take_goblet/Prefabs/Levels/lvl_7.prefab

@@ -3953,7 +3953,9 @@
     "waitArea": {
       "__id__": 30
     },
-    "tempCups": null,
+    "tempCups": {
+      "__id__": 69
+    },
     "originArea": {
       "__id__": 152
     },

+ 1 - 0
assets/module_take_goblet/Script/Component/CocktailCup.ts

@@ -66,6 +66,7 @@ export class CocktailCup extends Component {
 
     //补满水
     public async fillUp() {
+        if (!this.node) return;
         TakeGobletAudioMgr.playOneShot(TakeGobletAudioMgr.getMusicIdName(5), 1.0);
         this.playAnimationByState(CocktailCupState.Full);
         await GameUtil.delay(0.5);

+ 4 - 3
assets/module_take_goblet/Script/Component/OriginCup.ts

@@ -1,6 +1,6 @@
 import { _decorator, CCInteger, Component, Enum, find, Node, sp, tween, UITransform, Vec3, view } from 'cc';
 import { CupHeight, TakeGobletGlobalInstance, WaterColors } from '../TakeGobletGlobalInstance';
-import { LevelAction } from '../LevelAction';
+import { ANIMATION_DURATION, LevelAction } from '../LevelAction';
 import { EventDispatcher } from 'db://assets/core_tgx/easy_ui_framework/EventDispatcher';
 import { GameEvent } from '../Enum/GameEvent';
 import { Water } from './Water';
@@ -80,7 +80,7 @@ export class OriginCup extends Component {
 
             // 移动动画到原位置
             tween(this.node)
-                .to(0.5, { position: targetPos })
+                .to(ANIMATION_DURATION, { position: targetPos })
                 .call(() => {
                     const markCount = levelAction.originArea?.getComponent(OriginArea)?.getTotalMarkCount();
                     console.log(`mark总数:${markCount}`);
@@ -147,7 +147,8 @@ export class OriginCup extends Component {
     }
 
     hideCurrentWaterLayer() {
-        const activeWaters = this.waters.children.filter(n => n.active);
+        if (!this.waters) return;
+        const activeWaters = this.waters!.children.filter(n => n.active);
         if (activeWaters.length >= 0) {
             activeWaters[activeWaters.length - 1].active = false;
         }

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

@@ -19,6 +19,9 @@ import { GlobalConfig } from '../../start/Config/GlobalConfig';
 import { AdvertMgr } from '../../core_tgx/base/ad/AdvertMgr';
 const { ccclass, property } = _decorator;
 
+//动画时长
+export const ANIMATION_DURATION = 0.3;
+
 @ccclass('LevelAction')
 export class LevelAction extends Component {
 
@@ -304,6 +307,7 @@ export class LevelAction extends Component {
             }
 
             // 处理完所有颜色后检查剩余水层
+            if (!originCup.waters) return
             const remaining = originCup.waters.children.filter(n => n.active).length;
             if (hasUnprocessed || remaining > 0) {
                 // console.log("游戏结束:仍有未处理的水层");
@@ -333,7 +337,7 @@ export class LevelAction extends Component {
         this.isProcessing = true;
 
         try {
-            const tempCupsComp = this.tempCups.getComponent(TempCups)!;
+            const tempCupsComp = this.tempCups!.getComponent(TempCups)!;
             const filledCups = tempCupsComp.getFilledCups();
 
             for (const tempCup of filledCups) {
@@ -363,7 +367,7 @@ export class LevelAction extends Component {
                     if (originalPos) {
                         await new Promise(resolve => {
                             tween(tempCup.node)
-                                .to(0.3, { position: originalPos })
+                                .to(ANIMATION_DURATION, { position: originalPos })
                                 .call(() => {
                                     tempCup.reset();
                                     resolve(true);
@@ -417,7 +421,7 @@ export class LevelAction extends Component {
         if (this.waitArea.getCups().length > 0) {
             this.outArea.getCups().concat(this.waitArea.getCups()).forEach(cup => {
                 tween(cup)
-                    .by(0.3, { position: new Vec3(byX, 0, 0) }, { easing: 'sineOut' })
+                    .by(ANIMATION_DURATION, { position: new Vec3(byX, 0, 0) }, { easing: 'sineOut' })
                     .start();
             });
         }
@@ -448,14 +452,24 @@ export class LevelAction extends Component {
     ) {
         const targetWorldPos = target.getWorldPosition().clone();
         const tempRegex = /TempCup/.test(origin.name);
+
+        let targetPosY: number = 135;
+        if (origin.getComponent(OriginCup)) {
+            const targetCup = origin.getComponent(OriginCup)!;
+            if (targetCup.cupHeight == CupHeight.Two) {
+                targetPosY = 165;
+            } else if (targetCup.cupHeight == CupHeight.Four) {
+                targetPosY = 105;
+            }
+        }
         // 调整偏移量
         targetWorldPos.x -= !tempRegex ? 55 : 20;
-        targetWorldPos.y += !tempRegex ? 125 : 205;
+        targetWorldPos.y += !tempRegex ? targetPosY : 205;
 
         // 移动动画到目标位置
         await new Promise<void>(resolve => {
             tween(origin)
-                .to(0.5, { worldPosition: targetWorldPos })
+                .to(ANIMATION_DURATION, { worldPosition: targetWorldPos })
                 .call(resolve)
                 .start();
         });

+ 1 - 1
assets/module_take_goblet/Script/TakeGobletGlobalInstance.ts

@@ -101,7 +101,7 @@ export class TakeGobletGlobalInstance {
         ];
     }
 
-    //获取调酒杯规则
+    //获取调酒杯规则 若干个X调酒杯出现的颜色种类y上限
     cocktailCupRule(): number[] {
         const { wineglass_color } = LevelManager.instance.levelModel.levelConfig;
         return wineglass_color;

+ 2 - 2
assets/module_take_goblet/rooster_takegoblet.scene

@@ -1224,7 +1224,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": -296.947,
-      "y": 571.83,
+      "y": 648.368,
       "z": 0
     },
     "_lrot": {
@@ -2033,7 +2033,7 @@
     "_target": null,
     "_left": 13.052999999999997,
     "_right": 0,
-    "_top": 18.16999999999996,
+    "_top": -58.36800000000005,
     "_bottom": 0,
     "_horizontalCenter": 0,
     "_verticalCenter": 0,

+ 47 - 62
assets/start/start.scene

@@ -52,7 +52,7 @@
     },
     "autoReleaseAssets": false,
     "_globals": {
-      "__id__": 28
+      "__id__": 27
     },
     "_id": "9e293cde-e27b-4902-808b-e884f3e9da32"
   },
@@ -72,14 +72,17 @@
         "__id__": 5
       },
       {
-        "__id__": 10
+        "__id__": 9
       },
       {
-        "__id__": 13
+        "__id__": 12
       }
     ],
     "_active": true,
     "_components": [
+      {
+        "__id__": 22
+      },
       {
         "__id__": 23
       },
@@ -91,9 +94,6 @@
       },
       {
         "__id__": 26
-      },
-      {
-        "__id__": 27
       }
     ],
     "_prefab": null,
@@ -236,9 +236,6 @@
       },
       {
         "__id__": 8
-      },
-      {
-        "__id__": 9
       }
     ],
     "_prefab": null,
@@ -257,8 +254,8 @@
     },
     "_lscale": {
       "__type__": "cc.Vec3",
-      "x": 0.5311203319502075,
-      "y": 0.5311203319502075,
+      "x": 0.6666666666666666,
+      "y": 0.6666666666666666,
       "z": 0
     },
     "_mobility": 0,
@@ -283,8 +280,8 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 2711.25,
-      "height": 17957.9013427443
+      "width": 1080,
+      "height": 1920
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -332,18 +329,6 @@
     "_atlas": null,
     "_id": "6fdFqTuPFBu5N1cfHuoMFG"
   },
-  {
-    "__type__": "df9c1XeTcVFJp2J7fsaRMc+",
-    "_name": "",
-    "_objFlags": 0,
-    "__editorExtras__": {},
-    "node": {
-      "__id__": 5
-    },
-    "_enabled": true,
-    "__prefab": null,
-    "_id": "69dGEGdDdGCojcTSXYK/DD"
-  },
   {
     "__type__": "cc.Widget",
     "_name": "",
@@ -356,10 +341,10 @@
     "__prefab": null,
     "_alignFlags": 45,
     "_target": null,
-    "_left": -360,
-    "_right": -360,
-    "_top": -4128.903261143714,
-    "_bottom": -4128.903261143714,
+    "_left": 0,
+    "_right": 0,
+    "_top": 0,
+    "_bottom": 0,
     "_horizontalCenter": 0,
     "_verticalCenter": 0,
     "_isAbsLeft": true,
@@ -386,10 +371,10 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 11
+        "__id__": 10
       },
       {
-        "__id__": 12
+        "__id__": 11
       }
     ],
     "_prefab": null,
@@ -428,7 +413,7 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 10
+      "__id__": 9
     },
     "_enabled": true,
     "__prefab": null,
@@ -450,7 +435,7 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 10
+      "__id__": 9
     },
     "_enabled": true,
     "__prefab": null,
@@ -493,22 +478,22 @@
     },
     "_children": [
       {
-        "__id__": 14
+        "__id__": 13
       },
       {
-        "__id__": 17
+        "__id__": 16
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 20
+        "__id__": 19
       },
       {
-        "__id__": 21
+        "__id__": 20
       },
       {
-        "__id__": 22
+        "__id__": 21
       }
     ],
     "_prefab": null,
@@ -547,16 +532,16 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "_parent": {
-      "__id__": 13
+      "__id__": 12
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 15
+        "__id__": 14
       },
       {
-        "__id__": 16
+        "__id__": 15
       }
     ],
     "_prefab": null,
@@ -595,7 +580,7 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 14
+      "__id__": 13
     },
     "_enabled": true,
     "__prefab": null,
@@ -617,7 +602,7 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 14
+      "__id__": 13
     },
     "_enabled": true,
     "__prefab": null,
@@ -656,16 +641,16 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "_parent": {
-      "__id__": 13
+      "__id__": 12
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 18
+        "__id__": 17
       },
       {
-        "__id__": 19
+        "__id__": 18
       }
     ],
     "_prefab": null,
@@ -704,7 +689,7 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 17
+      "__id__": 16
     },
     "_enabled": true,
     "__prefab": null,
@@ -726,7 +711,7 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 17
+      "__id__": 16
     },
     "_enabled": true,
     "__prefab": null,
@@ -791,7 +776,7 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 13
+      "__id__": 12
     },
     "_enabled": true,
     "__prefab": null,
@@ -813,7 +798,7 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 13
+      "__id__": 12
     },
     "_enabled": true,
     "__prefab": null,
@@ -852,12 +837,12 @@
     "_objFlags": 0,
     "__editorExtras__": {},
     "node": {
-      "__id__": 13
+      "__id__": 12
     },
     "_enabled": true,
     "__prefab": null,
     "_barSprite": {
-      "__id__": 16
+      "__id__": 15
     },
     "_mode": 2,
     "_totalLength": 1,
@@ -944,14 +929,14 @@
     "_enabled": true,
     "__prefab": null,
     "txtLoading": {
-      "__id__": 19
+      "__id__": 18
     },
     "uiCanvasPrefab": {
       "__uuid__": "469e39c1-3bdc-4490-987b-99aaa169fdf4",
       "__expectedType__": "cc.Prefab"
     },
     "loadingBar": {
-      "__id__": 22
+      "__id__": 21
     },
     "_id": "ccwYlVBqtP3qOrWWpSPSZW"
   },
@@ -975,28 +960,28 @@
   {
     "__type__": "cc.SceneGlobals",
     "ambient": {
-      "__id__": 29
+      "__id__": 28
     },
     "shadows": {
-      "__id__": 30
+      "__id__": 29
     },
     "_skybox": {
-      "__id__": 31
+      "__id__": 30
     },
     "fog": {
-      "__id__": 32
+      "__id__": 31
     },
     "octree": {
-      "__id__": 33
+      "__id__": 32
     },
     "skin": {
-      "__id__": 34
+      "__id__": 33
     },
     "lightProbeInfo": {
-      "__id__": 35
+      "__id__": 34
     },
     "postSettings": {
-      "__id__": 36
+      "__id__": 35
     },
     "bakedWithStationaryMainLight": false,
     "bakedWithHighpLightmap": false