Browse Source

屏蔽打印

woso_javan 3 months ago
parent
commit
77b14a4514

+ 2 - 2
assets/module_take_goblet/Script/Component/OriginCup.ts

@@ -103,7 +103,7 @@ export class OriginCup extends Component {
             const mark = TakeGobletGlobalInstance.instance.refreshQuestionWater(markCount);
             water.color = colors[Math.floor(Math.random() * colors.length)];
             waterNode.active = true;
-            console.log(`i:${i} --  marks.children[i].name:${marks.children[i].name}`);
+            // console.log(`i:${i} --  marks.children[i].name:${marks.children[i].name}`);
             if (mark) {
                 marks.children[i].active = true;
             }
@@ -185,7 +185,7 @@ export class OriginCup extends Component {
 
     destroyOriginCup() {
         const id = this.node.uuid;
-        console.log('销毁原浆杯id : ', id);
+        // console.log('销毁原浆杯id : ', id);
         tween(this.node)
             .to(0.3, { scale: Vec3.ZERO })
             .call(() => {

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

@@ -63,7 +63,7 @@ export class Water extends Component {
     playPourWaterAnimation(index: number) {
         if (!this.skeleton) return;
 
-        console.log(`动画名:pour_0${index} -- index:${index}`);
+        // console.log(`动画名:pour_0${index} -- index:${index}`);
         this.skeleton.setAnimation(0, `pour_0${index}`, false);
     }
 }

+ 7 - 14
assets/module_take_goblet/Script/LevelAction.ts

@@ -377,6 +377,7 @@ export class LevelAction extends Component {
             });
         }
 
+        await GameUtil.delay(0.2);
         // 在添加完成后处理暂存区倒水
         await this.handlePourTempCupToOutArea();
 
@@ -400,24 +401,16 @@ export class LevelAction extends Component {
         originalPos?: Vec3,
         isTempCup: boolean = false
     ) {
-        // 使用正确的坐标转换
-        const originParent = origin.parent!;
-        const targetWorldPos = target.worldPosition;
-        const localPos = originParent.getComponent(UITransform)!.convertToNodeSpaceAR(targetWorldPos);
-
-        // 调整Y轴偏移量
-        if (isTempCup) {
-            localPos.x -= 55; // 暂存杯偏移
-            localPos.y += 115;
-        } else {
-            localPos.x -= 50; // 调酒杯偏移
-            localPos.y += 100;
-        }
+        const targetWorldPos = target.getWorldPosition().clone();
+        const tempRegex = /TempCup/.test(origin.name);
+        // 调整偏移量
+        targetWorldPos.x -= !tempRegex ? 55 : 20;
+        targetWorldPos.y += !tempRegex ? 115 : 215;
 
         // 移动动画到目标位置
         await new Promise<void>(resolve => {
             tween(origin)
-                .to(0.5, { position: localPos })
+                .to(0.5, { worldPosition: targetWorldPos })
                 .call(resolve)
                 .start();
         });