From 431401c52fea2ee036b2dfb18f10bbd823fee66a Mon Sep 17 00:00:00 2001 From: bottlefish <781230111@qq.com> Date: Mon, 13 Jul 2026 22:55:12 +0800 Subject: [PATCH] =?UTF-8?q?fix(huoshan):=20=E4=BF=AE=E5=A4=8D=E5=8F=91?= =?UTF-8?q?=E6=9D=A1=E7=BB=88=E7=82=B9=E5=88=A4=E5=AE=9A=E4=B8=8E=E8=B6=8A?= =?UTF-8?q?=E7=95=8C=E6=8B=96=E6=8B=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- .../HuoShan/SalesSystem/CrankController.cs | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/Assets/Scripts/MiniGame/HuoShan/SalesSystem/CrankController.cs b/Assets/Scripts/MiniGame/HuoShan/SalesSystem/CrankController.cs index 25396ec9e..6e87e5b41 100644 --- a/Assets/Scripts/MiniGame/HuoShan/SalesSystem/CrankController.cs +++ b/Assets/Scripts/MiniGame/HuoShan/SalesSystem/CrankController.cs @@ -138,12 +138,17 @@ namespace AibisDream.MiniGame.HuoShan crankTransform = transform; } - // 确保触发角度不超过最大旋转角度 + maxRotationAngle = Mathf.Max(0.01f, maxRotationAngle); + dragResistance = Mathf.Clamp01(dragResistance); + + // 完成判定不能超过画面上的旋转终点。 + // 旧逻辑会在配置越界时悄悄改为 80%,导致画面、手感和判定使用不同的角度。 if (triggerAngle > maxRotationAngle) { - Debug.LogWarning($"[CrankController] triggerAngle ({triggerAngle}°) 超过 maxRotationAngle ({maxRotationAngle}°),已自动调整为 {maxRotationAngle * 0.8f:F0}°", this); - triggerAngle = maxRotationAngle * 0.8f; + Debug.LogWarning($"[CrankController] triggerAngle ({triggerAngle}°) 超过 maxRotationAngle ({maxRotationAngle}°),已对齐到旋转终点", this); + triggerAngle = maxRotationAngle; } + triggerAngle = Mathf.Clamp(triggerAngle, 0f, maxRotationAngle); // 未配置交互碰撞体时,尝试从 crankTransform 获取 if (interactionCollider == null && crankTransform != null) @@ -474,9 +479,9 @@ namespace AibisDream.MiniGame.HuoShan float targetRotation = _currentRotation + frameDelta * (1f - dragResistance); - // 仅当目标在范围内时更新,超出范围则保持当前位置不跟过去 - if (targetRotation >= 0f && targetRotation <= maxRotationAngle) - _currentRotation = targetRotation; + // 拖拽一帧跨过起点/终点时直接夹到边界。 + // 若拒绝越界的整帧移动,当触发角度等于最大角度时就可能永远到不了终点。 + _currentRotation = Mathf.Clamp(targetRotation, 0f, maxRotationAngle); ApplyCrankTransform(_currentRotation); @@ -516,7 +521,8 @@ namespace AibisDream.MiniGame.HuoShan }, maxRotationAngle, Mathf.Max(0.01f, completionSnapDuration)) - .SetEase(Ease.OutBack) + // OutBack 会超过 maxRotationAngle,导致实际画面角度大于配置上限。 + .SetEase(Ease.OutCubic) .OnComplete(() => { _completeTween = null;