Browse Source

fixed bug

woso_javan 3 months ago
parent
commit
70054dabd8

+ 76 - 52
assets/module_take_goblet/Prefabs/Levels/lvl_1.prefab

@@ -34,14 +34,14 @@
     "_active": true,
     "_active": true,
     "_components": [
     "_components": [
       {
       {
-        "__id__": 188
+        "__id__": 190
       },
       },
       {
       {
-        "__id__": 190
+        "__id__": 192
       }
       }
     ],
     ],
     "_prefab": {
     "_prefab": {
-      "__id__": 192
+      "__id__": 194
     },
     },
     "_lpos": {
     "_lpos": {
       "__type__": "cc.Vec3",
       "__type__": "cc.Vec3",
@@ -2614,26 +2614,26 @@
         "__id__": 151
         "__id__": 151
       },
       },
       {
       {
-        "__id__": 159
+        "__id__": 161
       },
       },
       {
       {
-        "__id__": 167
+        "__id__": 169
       },
       },
       {
       {
-        "__id__": 175
+        "__id__": 177
       }
       }
     ],
     ],
     "_active": true,
     "_active": true,
     "_components": [
     "_components": [
       {
       {
-        "__id__": 183
+        "__id__": 185
       },
       },
       {
       {
-        "__id__": 185
+        "__id__": 187
       }
       }
     ],
     ],
     "_prefab": {
     "_prefab": {
-      "__id__": 187
+      "__id__": 189
     },
     },
     "_lpos": {
     "_lpos": {
       "__type__": "cc.Vec3",
       "__type__": "cc.Vec3",
@@ -2822,6 +2822,9 @@
       },
       },
       {
       {
         "__id__": 158
         "__id__": 158
+      },
+      {
+        "__id__": 159
       }
       }
     ],
     ],
     "removedComponents": []
     "removedComponents": []
@@ -2888,6 +2891,27 @@
       "z": 0
       "z": 0
     }
     }
   },
   },
+  {
+    "__type__": "CCPropertyOverrideInfo",
+    "targetInfo": {
+      "__id__": 160
+    },
+    "propertyPath": [
+      "_lpos"
+    ],
+    "value": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    }
+  },
+  {
+    "__type__": "cc.TargetInfo",
+    "localID": [
+      "64CU6wdeNOjoMwg0hpUSzs"
+    ]
+  },
   {
   {
     "__type__": "cc.Node",
     "__type__": "cc.Node",
     "_objFlags": 0,
     "_objFlags": 0,
@@ -2895,14 +2919,14 @@
       "__id__": 142
       "__id__": 142
     },
     },
     "_prefab": {
     "_prefab": {
-      "__id__": 160
+      "__id__": 162
     },
     },
     "__editorExtras__": {}
     "__editorExtras__": {}
   },
   },
   {
   {
     "__type__": "cc.PrefabInfo",
     "__type__": "cc.PrefabInfo",
     "root": {
     "root": {
-      "__id__": 159
+      "__id__": 161
     },
     },
     "asset": {
     "asset": {
       "__uuid__": "2d87113d-1bb5-4ade-9c3d-07ddbd270c48",
       "__uuid__": "2d87113d-1bb5-4ade-9c3d-07ddbd270c48",
@@ -2910,7 +2934,7 @@
     },
     },
     "fileId": "c46/YsCPVOJYA4mWEpNYRx",
     "fileId": "c46/YsCPVOJYA4mWEpNYRx",
     "instance": {
     "instance": {
-      "__id__": 161
+      "__id__": 163
     },
     },
     "targetOverrides": []
     "targetOverrides": []
   },
   },
@@ -2924,16 +2948,16 @@
     "mountedComponents": [],
     "mountedComponents": [],
     "propertyOverrides": [
     "propertyOverrides": [
       {
       {
-        "__id__": 162
+        "__id__": 164
       },
       },
       {
       {
-        "__id__": 164
+        "__id__": 166
       },
       },
       {
       {
-        "__id__": 165
+        "__id__": 167
       },
       },
       {
       {
-        "__id__": 166
+        "__id__": 168
       }
       }
     ],
     ],
     "removedComponents": []
     "removedComponents": []
@@ -2941,7 +2965,7 @@
   {
   {
     "__type__": "CCPropertyOverrideInfo",
     "__type__": "CCPropertyOverrideInfo",
     "targetInfo": {
     "targetInfo": {
-      "__id__": 163
+      "__id__": 165
     },
     },
     "propertyPath": [
     "propertyPath": [
       "_name"
       "_name"
@@ -2957,7 +2981,7 @@
   {
   {
     "__type__": "CCPropertyOverrideInfo",
     "__type__": "CCPropertyOverrideInfo",
     "targetInfo": {
     "targetInfo": {
-      "__id__": 163
+      "__id__": 165
     },
     },
     "propertyPath": [
     "propertyPath": [
       "_lpos"
       "_lpos"
@@ -2972,7 +2996,7 @@
   {
   {
     "__type__": "CCPropertyOverrideInfo",
     "__type__": "CCPropertyOverrideInfo",
     "targetInfo": {
     "targetInfo": {
-      "__id__": 163
+      "__id__": 165
     },
     },
     "propertyPath": [
     "propertyPath": [
       "_lrot"
       "_lrot"
@@ -2988,7 +3012,7 @@
   {
   {
     "__type__": "CCPropertyOverrideInfo",
     "__type__": "CCPropertyOverrideInfo",
     "targetInfo": {
     "targetInfo": {
-      "__id__": 163
+      "__id__": 165
     },
     },
     "propertyPath": [
     "propertyPath": [
       "_euler"
       "_euler"
@@ -3007,14 +3031,14 @@
       "__id__": 142
       "__id__": 142
     },
     },
     "_prefab": {
     "_prefab": {
-      "__id__": 168
+      "__id__": 170
     },
     },
     "__editorExtras__": {}
     "__editorExtras__": {}
   },
   },
   {
   {
     "__type__": "cc.PrefabInfo",
     "__type__": "cc.PrefabInfo",
     "root": {
     "root": {
-      "__id__": 167
+      "__id__": 169
     },
     },
     "asset": {
     "asset": {
       "__uuid__": "2d87113d-1bb5-4ade-9c3d-07ddbd270c48",
       "__uuid__": "2d87113d-1bb5-4ade-9c3d-07ddbd270c48",
@@ -3022,7 +3046,7 @@
     },
     },
     "fileId": "c46/YsCPVOJYA4mWEpNYRx",
     "fileId": "c46/YsCPVOJYA4mWEpNYRx",
     "instance": {
     "instance": {
-      "__id__": 169
+      "__id__": 171
     },
     },
     "targetOverrides": []
     "targetOverrides": []
   },
   },
@@ -3036,16 +3060,16 @@
     "mountedComponents": [],
     "mountedComponents": [],
     "propertyOverrides": [
     "propertyOverrides": [
       {
       {
-        "__id__": 170
+        "__id__": 172
       },
       },
       {
       {
-        "__id__": 172
+        "__id__": 174
       },
       },
       {
       {
-        "__id__": 173
+        "__id__": 175
       },
       },
       {
       {
-        "__id__": 174
+        "__id__": 176
       }
       }
     ],
     ],
     "removedComponents": []
     "removedComponents": []
@@ -3053,7 +3077,7 @@
   {
   {
     "__type__": "CCPropertyOverrideInfo",
     "__type__": "CCPropertyOverrideInfo",
     "targetInfo": {
     "targetInfo": {
-      "__id__": 171
+      "__id__": 173
     },
     },
     "propertyPath": [
     "propertyPath": [
       "_name"
       "_name"
@@ -3069,7 +3093,7 @@
   {
   {
     "__type__": "CCPropertyOverrideInfo",
     "__type__": "CCPropertyOverrideInfo",
     "targetInfo": {
     "targetInfo": {
-      "__id__": 171
+      "__id__": 173
     },
     },
     "propertyPath": [
     "propertyPath": [
       "_lpos"
       "_lpos"
@@ -3084,7 +3108,7 @@
   {
   {
     "__type__": "CCPropertyOverrideInfo",
     "__type__": "CCPropertyOverrideInfo",
     "targetInfo": {
     "targetInfo": {
-      "__id__": 171
+      "__id__": 173
     },
     },
     "propertyPath": [
     "propertyPath": [
       "_lrot"
       "_lrot"
@@ -3100,7 +3124,7 @@
   {
   {
     "__type__": "CCPropertyOverrideInfo",
     "__type__": "CCPropertyOverrideInfo",
     "targetInfo": {
     "targetInfo": {
-      "__id__": 171
+      "__id__": 173
     },
     },
     "propertyPath": [
     "propertyPath": [
       "_euler"
       "_euler"
@@ -3119,14 +3143,14 @@
       "__id__": 142
       "__id__": 142
     },
     },
     "_prefab": {
     "_prefab": {
-      "__id__": 176
+      "__id__": 178
     },
     },
     "__editorExtras__": {}
     "__editorExtras__": {}
   },
   },
   {
   {
     "__type__": "cc.PrefabInfo",
     "__type__": "cc.PrefabInfo",
     "root": {
     "root": {
-      "__id__": 175
+      "__id__": 177
     },
     },
     "asset": {
     "asset": {
       "__uuid__": "b2b2d79c-c7e4-4837-a088-af4658142583",
       "__uuid__": "b2b2d79c-c7e4-4837-a088-af4658142583",
@@ -3134,7 +3158,7 @@
     },
     },
     "fileId": "c46/YsCPVOJYA4mWEpNYRx",
     "fileId": "c46/YsCPVOJYA4mWEpNYRx",
     "instance": {
     "instance": {
-      "__id__": 177
+      "__id__": 179
     },
     },
     "targetOverrides": []
     "targetOverrides": []
   },
   },
@@ -3148,16 +3172,16 @@
     "mountedComponents": [],
     "mountedComponents": [],
     "propertyOverrides": [
     "propertyOverrides": [
       {
       {
-        "__id__": 178
+        "__id__": 180
       },
       },
       {
       {
-        "__id__": 180
+        "__id__": 182
       },
       },
       {
       {
-        "__id__": 181
+        "__id__": 183
       },
       },
       {
       {
-        "__id__": 182
+        "__id__": 184
       }
       }
     ],
     ],
     "removedComponents": []
     "removedComponents": []
@@ -3165,7 +3189,7 @@
   {
   {
     "__type__": "CCPropertyOverrideInfo",
     "__type__": "CCPropertyOverrideInfo",
     "targetInfo": {
     "targetInfo": {
-      "__id__": 179
+      "__id__": 181
     },
     },
     "propertyPath": [
     "propertyPath": [
       "_name"
       "_name"
@@ -3181,7 +3205,7 @@
   {
   {
     "__type__": "CCPropertyOverrideInfo",
     "__type__": "CCPropertyOverrideInfo",
     "targetInfo": {
     "targetInfo": {
-      "__id__": 179
+      "__id__": 181
     },
     },
     "propertyPath": [
     "propertyPath": [
       "_lpos"
       "_lpos"
@@ -3196,7 +3220,7 @@
   {
   {
     "__type__": "CCPropertyOverrideInfo",
     "__type__": "CCPropertyOverrideInfo",
     "targetInfo": {
     "targetInfo": {
-      "__id__": 179
+      "__id__": 181
     },
     },
     "propertyPath": [
     "propertyPath": [
       "_lrot"
       "_lrot"
@@ -3212,7 +3236,7 @@
   {
   {
     "__type__": "CCPropertyOverrideInfo",
     "__type__": "CCPropertyOverrideInfo",
     "targetInfo": {
     "targetInfo": {
-      "__id__": 179
+      "__id__": 181
     },
     },
     "propertyPath": [
     "propertyPath": [
       "_euler"
       "_euler"
@@ -3234,7 +3258,7 @@
     },
     },
     "_enabled": true,
     "_enabled": true,
     "__prefab": {
     "__prefab": {
-      "__id__": 184
+      "__id__": 186
     },
     },
     "_contentSize": {
     "_contentSize": {
       "__type__": "cc.Size",
       "__type__": "cc.Size",
@@ -3262,7 +3286,7 @@
     },
     },
     "_enabled": true,
     "_enabled": true,
     "__prefab": {
     "__prefab": {
-      "__id__": 186
+      "__id__": 188
     },
     },
     "_id": ""
     "_id": ""
   },
   },
@@ -3293,7 +3317,7 @@
     },
     },
     "_enabled": true,
     "_enabled": true,
     "__prefab": {
     "__prefab": {
-      "__id__": 189
+      "__id__": 191
     },
     },
     "_contentSize": {
     "_contentSize": {
       "__type__": "cc.Size",
       "__type__": "cc.Size",
@@ -3321,7 +3345,7 @@
     },
     },
     "_enabled": true,
     "_enabled": true,
     "__prefab": {
     "__prefab": {
-      "__id__": 191
+      "__id__": 193
     },
     },
     "outArea": {
     "outArea": {
       "__id__": 54
       "__id__": 54
@@ -3353,18 +3377,18 @@
     "instance": null,
     "instance": null,
     "targetOverrides": [
     "targetOverrides": [
       {
       {
-        "__id__": 193
+        "__id__": 195
       }
       }
     ],
     ],
     "nestedPrefabInstanceRoots": [
     "nestedPrefabInstanceRoots": [
       {
       {
-        "__id__": 175
+        "__id__": 177
       },
       },
       {
       {
-        "__id__": 167
+        "__id__": 169
       },
       },
       {
       {
-        "__id__": 159
+        "__id__": 161
       },
       },
       {
       {
         "__id__": 151
         "__id__": 151
@@ -3398,7 +3422,7 @@
       "__id__": 68
       "__id__": 68
     },
     },
     "sourceInfo": {
     "sourceInfo": {
-      "__id__": 194
+      "__id__": 196
     },
     },
     "propertyPath": [
     "propertyPath": [
       "waters"
       "waters"
@@ -3407,7 +3431,7 @@
       "__id__": 68
       "__id__": 68
     },
     },
     "targetInfo": {
     "targetInfo": {
-      "__id__": 195
+      "__id__": 197
     }
     }
   },
   },
   {
   {

+ 6 - 0
assets/module_take_goblet/Script/Component/TempCup.ts

@@ -97,6 +97,12 @@ export class TempCup extends Component {
     }
     }
 
 
     reset() {
     reset() {
+        this._currentColor = WaterColors.White;
+        let cupColor = new Color(WaterColorHex[this.currentColor]);
+        let waterNode = this.waters.children[0];
+        let waterSpine = waterNode.getComponent(sp.Skeleton)!;
+        this.colorB.color = cupColor;
+        waterSpine.color = cupColor;
         this._isFull = false;
         this._isFull = false;
         this.playAnimation(TempCupState.Default);
         this.playAnimation(TempCupState.Default);
     }
     }

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

@@ -405,7 +405,7 @@ export class LevelAction extends Component {
         const tempRegex = /TempCup/.test(origin.name);
         const tempRegex = /TempCup/.test(origin.name);
         // 调整偏移量
         // 调整偏移量
         targetWorldPos.x -= !tempRegex ? 55 : 20;
         targetWorldPos.x -= !tempRegex ? 55 : 20;
-        targetWorldPos.y += !tempRegex ? 115 : 215;
+        targetWorldPos.y += !tempRegex ? 125 : 205;
 
 
         // 移动动画到目标位置
         // 移动动画到目标位置
         await new Promise<void>(resolve => {
         await new Promise<void>(resolve => {

+ 1 - 1
assets/module_take_goblet/Script/Model/LevelModel.ts

@@ -63,7 +63,7 @@ export class LevelModel {
         this.levelColors = [];
         this.levelColors = [];
         const allColors = Object.values(WaterColors).filter(v => !isNaN(Number(v)) && v != WaterColors.Black) as WaterColors[];
         const allColors = Object.values(WaterColors).filter(v => !isNaN(Number(v)) && v != WaterColors.Black) as WaterColors[];
         // Fisher-Yates 洗牌算法
         // Fisher-Yates 洗牌算法
-        for (let i = allColors.length - 1; i > 0; i--) {
+        for (let i = allColors.length - 2; i > 0; i--) {
             const j = Math.floor(Math.random() * (i + 1));
             const j = Math.floor(Math.random() * (i + 1));
             [allColors[i], allColors[j]] = [allColors[j], allColors[i]];
             [allColors[i], allColors[j]] = [allColors[j], allColors[i]];
         }
         }

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

@@ -171,6 +171,7 @@ export enum WaterColors {
     Blue = 8, // 蓝
     Blue = 8, // 蓝
     DarkBlue = 9, // 深蓝
     DarkBlue = 9, // 深蓝
     Black = 10, // 黑
     Black = 10, // 黑
+    White = 11, // 白
 }
 }
 
 
 // 定义对应的十六进制颜色值
 // 定义对应的十六进制颜色值
@@ -185,6 +186,7 @@ export const WaterColorHex: Record<WaterColors, string> = {
     [WaterColors.Magenta]: "#EE60FE",
     [WaterColors.Magenta]: "#EE60FE",
     [WaterColors.DarkBlue]: "#3052A1",
     [WaterColors.DarkBlue]: "#3052A1",
     [WaterColors.Black]: "#131313",
     [WaterColors.Black]: "#131313",
+    [WaterColors.White]: "#FFFFFF"
 };
 };
 
 
 export const WaterColorLog: Record<WaterColors, string> = {
 export const WaterColorLog: Record<WaterColors, string> = {
@@ -197,7 +199,8 @@ export const WaterColorLog: Record<WaterColors, string> = {
     [WaterColors.Purple]: "紫色",
     [WaterColors.Purple]: "紫色",
     [WaterColors.Magenta]: '紫红色',
     [WaterColors.Magenta]: '紫红色',
     [WaterColors.DarkBlue]: '深蓝色',
     [WaterColors.DarkBlue]: '深蓝色',
-    [WaterColors.Black]: '黑色'
+    [WaterColors.Black]: '黑色',
+    [WaterColors.White]: '白色'
 };
 };
 
 
 /**杯子高度*/
 /**杯子高度*/