This commit is contained in:
2025-06-03 21:50:35 +08:00
parent 5bd103ceec
commit c8b0f8b375
46 changed files with 6296 additions and 1914 deletions
@@ -328,6 +328,10 @@ public class ShockSystem : MonoBehaviour
flashSequence.Kill();
}
// 获取ECG波形组件
var lightSystem = FixSystemCenter.SystemDic.Get<FixLightSystem>();
var originalWaveType = lightSystem?.GetCurrentWaveType();
flashSequence = DOTween.Sequence();
currentFlashHeadIndex = 0;
@@ -343,6 +347,12 @@ public class ShockSystem : MonoBehaviour
flashBackgroundSpriteRenderer.color = new Color(0, 0, 0, 1f); // 确保初始alpha为0
}
// 设置ECG为直线
if (lightSystem != null)
{
lightSystem.SetWaveType(RobotECGWave.WaveType.Flatline);
}
// 创建指定次数的闪烁
for (int i = 0; i < flashCount; i++)
{
@@ -388,9 +398,10 @@ public class ShockSystem : MonoBehaviour
// 等待序列完成
yield return flashSequence.WaitForCompletion();
// 闪烁结束后禁用所有精灵并重置状态
if (flashHeadSpriteRenderer != null)
// 恢复ECG波形
if (lightSystem != null && originalWaveType.HasValue)
{
lightSystem.SetWaveType(originalWaveType.Value);
flashHeadSpriteRenderer.gameObject.SetActive(false);
flashHeadSpriteRenderer.color = new Color(1, 1, 1, 0);
flashHeadSpriteRenderer.sprite = flashHeadSprites[0];