woso_javan 3 ماه پیش
والد
کامیت
6e86b00f73

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

@@ -71,7 +71,7 @@ export class CocktailCup extends Component {
         // 补满后执行移动销毁动画
         const uiTransform = this.node.getComponent(UITransform)!;
         const screenWidth = view.getVisibleSize().width;
-        const targetX = screenWidth / 2 + uiTransform.width * 1.5;
+        const targetX = screenWidth + uiTransform.width * 1.5;
 
         await new Promise<void>(resolve => {
             tween(this.node)

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

@@ -1,4 +1,4 @@
-import { _decorator, CCInteger, Component, Enum, find, Node, sp, tween, UITransform, Vec3 } from 'cc';
+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 { EventDispatcher } from 'db://assets/core_tgx/easy_ui_framework/EventDispatcher';
@@ -183,16 +183,22 @@ export class OriginCup extends Component {
         this.marks.active = bool;
     }
 
-    destroyOriginCup() {
+    async destroyOriginCup() {
         const id = this.node.uuid;
-        // console.log('销毁原浆杯id : ', id);
-        tween(this.node)
-            .to(0.3, { scale: Vec3.ZERO })
-            .call(() => {
-                EventDispatcher.instance.emit(GameEvent.EVENT_ORIGIN_CUP_DESTROYED, id);
-                this.node.destroy();
-            })
-            .start();
+        const uiTransform = this.node.getComponent(UITransform)!;
+        const screenWidth = view.getVisibleSize().width;
+        const targetX = -screenWidth - uiTransform.width * 1.5;
+
+        await new Promise<void>(resolve => {
+            tween(this.node)
+                .to(0.2, { position: new Vec3(targetX, this.node.position.y, 0) }, { easing: 'sineIn' })
+                .call(async () => {
+                    EventDispatcher.instance.emit(GameEvent.EVENT_ORIGIN_CUP_DESTROYED, id);
+                    this.node.destroy();
+                    resolve();
+                })
+                .start();
+        });
     }
 }
 

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

@@ -273,7 +273,7 @@ export class LevelAction extends Component {
                 tgxUIMgr.inst.showUI(UI_BattleResult);
             } else {
                 // 所有水层处理完毕,销毁原浆杯
-                originCup.destroyOriginCup();
+                await originCup.destroyOriginCup();
                 this.addWaitCupToOutArea();
             }
         } finally {
@@ -334,7 +334,6 @@ export class LevelAction extends Component {
 
     // 添加新杯子后触发暂存区倒水
     private async addWaitCupToOutArea() {
-        // 原有添加逻辑保持不变
         const waitCups = this.waitArea.cups;
         const outCups = this.outArea.getCups();
         const needAddCount = outCups.length === 0 ? 2 : 1;