using UnityEngine; namespace AibisDream.SaveSystem { /// /// sections["fixPanel"]:FixPanel 壳层 + 线缆/插头 + TaskPanel。RestoreOrder=66,在 fix(65) 之后写回面板/线缆/任务快照。 /// public class FixPanelSnapshotProvider : ISyncSnapshotProvider { public string SaveId => SnapshotProviderIds.FixPanel; public int RestoreOrder => 66; public object Capture() { if (!FixSceneSnapshotHelper.IsFixSceneActive()) { return null; } if (FixSystem.FixPanelSystem.Instance == null) { Debug.LogWarning("[FixPanelSnapshotProvider] FixPanelSystem 未初始化,跳过捕获。"); return null; } return FixSystem.FixPanelSystem.Instance.CapturePanelSnapshot(); } public void Restore(object dto, SnapshotRestoreContext context) { if (dto is not FixPanelSnapshotDto panelDto) { context.Warn("[FixPanelSnapshotProvider] DTO 类型不匹配,跳过还原。"); return; } if (!FixSceneSnapshotHelper.IsFixSceneActive()) { context.Log("[FixPanelSnapshotProvider] 当前非维修场景,跳过还原。"); return; } if (FixSystem.FixPanelSystem.Instance == null) { context.Warn("[FixPanelSnapshotProvider] FixPanelSystem 未初始化,跳过还原。"); return; } FixSystem.FixPanelSystem.Instance.ApplyPanelSnapshot(panelDto); } } }