feat(fix-system): 整合维修面板灯光系统并重构面板结构
Made-with: Cursor
This commit is contained in:
@@ -383,15 +383,15 @@ public class ShockSystem : MonoBehaviour
|
||||
yield return new WaitForSeconds(shockFlashDelay);
|
||||
|
||||
// 获取ECG波形组件
|
||||
var lightSystem = FixPanelSystem.GetRepairPanel<CablePanel>()?.FixLightSystem;
|
||||
var originalWaveType = lightSystem?.GetCurrentWaveType();
|
||||
var cablePanel = FixPanelSystem.GetRepairPanel<CablePanel>();
|
||||
var originalWaveType = cablePanel?.GetCurrentWaveType();
|
||||
|
||||
flashSequence = DOTween.Sequence();
|
||||
currentFlashHeadIndex = 0;
|
||||
|
||||
// 激活精灵渲染器
|
||||
if (flashHeadSpriteRenderer != null)
|
||||
{
|
||||
{
|
||||
flashHeadSpriteRenderer.gameObject.SetActive(true);
|
||||
flashHeadSpriteRenderer.color = new Color(1, 1, 1, 1); // 确保初始alpha为0
|
||||
}
|
||||
@@ -402,9 +402,9 @@ public class ShockSystem : MonoBehaviour
|
||||
}
|
||||
|
||||
// 设置ECG为直线
|
||||
if (lightSystem != null)
|
||||
if (cablePanel != null)
|
||||
{
|
||||
lightSystem.SetWaveType(RobotECGWave.WaveType.Flatline);
|
||||
cablePanel.SetWaveType(RobotECGWave.WaveType.Flatline);
|
||||
}
|
||||
|
||||
// 创建指定次数的闪烁
|
||||
@@ -453,9 +453,9 @@ public class ShockSystem : MonoBehaviour
|
||||
yield return flashSequence.WaitForCompletion();
|
||||
|
||||
// 恢复ECG波形
|
||||
if (lightSystem != null && originalWaveType.HasValue)
|
||||
if (cablePanel != null && originalWaveType.HasValue)
|
||||
{
|
||||
lightSystem.SetWaveType(originalWaveType.Value);
|
||||
cablePanel.SetWaveType(originalWaveType.Value);
|
||||
flashHeadSpriteRenderer.gameObject.SetActive(false);
|
||||
flashHeadSpriteRenderer.color = new Color(1, 1, 1, 0);
|
||||
flashHeadSpriteRenderer.sprite = flashHeadSprites[0];
|
||||
|
||||
Reference in New Issue
Block a user