using AibisDream.UI; using UnityEngine; namespace AibisDream.SaveSystem { /// /// screen section 的捕获/还原实现:屏幕后处理饱和度 + PlayToolPanel 遮罩终态(黑屏盖住 / 画面可见)。 /// screen section:饱和度 + PlayToolPanel 遮罩终态()。 /// 供 委托,避免 Provider 直接依赖 UI 细节。 /// public static class ScreenSnapshotHelper { public static ScreenSnapshotDto Capture() { var dto = new ScreenSnapshotDto(); if (ScreenEffectManager.Instance != null && ScreenEffectManager.Instance.saturation != null) { dto.saturationWeight = ScreenEffectManager.Instance.saturation.weight; } if (UIManager.Instance != null) { var panel = UIManager.Instance.GetPanel(); if (panel != null) { dto.isFadeScreenCovered = panel.CaptureFadeScreenCovered(); } } return dto; } public static void Restore(ScreenSnapshotDto dto) { if (dto == null) return; if (ScreenEffectManager.Instance != null && ScreenEffectManager.Instance.saturation != null) { ScreenEffectManager.Instance.saturation.weight = dto.saturationWeight; } if (UIManager.Instance != null) { var panel = UIManager.Instance.GetPanel(); panel?.ApplyFadeScreenCovered(dto.isFadeScreenCovered); } } } }