Selaa lähdekoodia

修改时间缩放率

woso_javan 3 kuukautta sitten
vanhempi
commit
c385c7aa66

+ 2 - 4
assets/module_take_goblet/Prefabs/Cup/Original/OriginalFour.prefab

@@ -427,6 +427,7 @@
     "__prefab": {
       "__id__": 17
     },
+    "sprite": null,
     "_id": ""
   },
   {
@@ -442,8 +443,6 @@
       "__id__": 0
     },
     "fileId": "777/KtNQ9DS6d87A9F0+5l",
-    "instance": null,
-    "targetOverrides": null,
     "nestedPrefabInstanceRoots": null
   },
   {
@@ -584,6 +583,7 @@
     "__prefab": {
       "__id__": 25
     },
+    "sprite": null,
     "_id": ""
   },
   {
@@ -599,8 +599,6 @@
       "__id__": 0
     },
     "fileId": "feDMH9HyNJLKFtbHKOh2gk",
-    "instance": null,
-    "targetOverrides": null,
     "nestedPrefabInstanceRoots": null
   },
   {

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

@@ -60,7 +60,7 @@ export class CocktailCup extends Component {
     async addLayer() {
         this.currentLayers++;
         this.playAnimationByState(CocktailCupState.GetWater);
-        await GameUtil.delay(0.5);
+        await GameUtil.delay(0.4);
         await this.checkAndDestroy();
     }
 
@@ -100,6 +100,7 @@ export class CocktailCup extends Component {
 
         switch (state) {
             case CocktailCupState.GetWater:
+                this.setSpineTimeScale(1.5);
                 allNodes.forEach(child => child.getComponent(sp.Skeleton)!.setAnimation(0, `pour_0${this.currentLayers}`, false));
                 break;
             case CocktailCupState.Move:
@@ -115,6 +116,15 @@ export class CocktailCup extends Component {
         }
     }
 
+    //设置spine 时间缩放率
+    setSpineTimeScale(timeScale: number = 1) {
+        if (!this.node) return;
+        const spineComponents = this.node.getComponentsInChildren(sp.Skeleton);
+        spineComponents.forEach(spine => {
+            spine.timeScale = timeScale;
+        });
+    }
+
     protected onDestroy(): void {
         EventDispatcher.instance.emit(GameEvent.EVENT_REFRESH_REMAIN_CUP);
     }

+ 10 - 1
assets/module_take_goblet/Script/Component/OriginCup.ts

@@ -179,13 +179,22 @@ export class OriginCup extends Component {
 
     playPourWaterAnimation(index: number) {
         if (!this.cupSkeleton) return;
-
+        this.setSpineTimeScale(1.5);
         this.cupSkeleton.setAnimation(0, `pour_0${index}`, false);
         this.waters.children.forEach(water => {
             water.getComponent(Water)?.playAnimation(OriginCupState.PourWater, index);
         });
     }
 
+    //设置spine 时间缩放率
+    setSpineTimeScale(timeScale: number = 1) {
+        if (!this.node) return;
+        const spineComponents = this.node.getComponentsInChildren(sp.Skeleton);
+        spineComponents.forEach(spine => {
+            spine.timeScale = timeScale;
+        });
+    }
+
     setMark(bool: boolean) {
         this.marks.active = bool;
     }

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

@@ -92,9 +92,19 @@ export class TempCup extends Component {
         }
     }
 
+    //设置spine 时间缩放率
+    setSpineTimeScale(timeScale: number = 1) {
+        if (!this.node) return;
+        const spineComponents = this.node.getComponentsInChildren(sp.Skeleton);
+        spineComponents.forEach(spine => {
+            spine.timeScale = timeScale;
+        });
+    }
+
     /**暂存杯 倒水动画*/
     pour() {
         TakeGobletAudioMgr.playOneShot(TakeGobletAudioMgr.getMusicIdName(4), 1.0);
+        this.setSpineTimeScale(1.5);
         this.playAnimation(TempCupState.PourWater);
     }
 

+ 2 - 2
assets/start/Config/GlobalConfig.ts

@@ -1,5 +1,5 @@
 export const GlobalConfig = {
-    isDebug: true,
+    isDebug: false,
     initilizeLevel: 1,//初始关卡
-    levelTotal: 2,   //最大关卡等级
+    levelTotal: 7,   //最大关卡等级
 }