fix(fixsystem): 修复发条归零时充能状态未重置

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-22 16:25:05 +08:00
co-authored by Cursor
parent 3d65941b03
commit 2fb32c44e8
@@ -326,8 +326,21 @@ public class ShockSystem : MonoBehaviour, IInteraction
lastMousePosition = mousePosition;
float progressRatio = targetLeverAngle / maxLeverAngle;
if (progressRatio <= 0f)
{
if (isCharging)
{
isCharging = false;
ResetProgress();
}
return;
}
if (progressRatio > 0 && !isCharging)
{
progressTweener?.Kill();
progressTweener = null;
isCharging = true;
StartCharging();
AibisDream.Kit.AudioManager.Instance.PlaySfx(chargingEvent, chargingAudioKey);
@@ -884,4 +897,4 @@ public class ShockLeverInteractionBridge : MonoBehaviour, IInteraction
public bool IsActive => _shockSystem?.IsActive ?? true;
public bool IsAvailable => _shockSystem?.IsAvailable ?? true;
public GameObject GetGameObject() => gameObject;
}
}