fix(fixsystem): 修复发条归零时充能状态未重置
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user