Files
aibis-dream/Assets/Scripts/SaveSystem/Providers/FixSnapshotProvider.cs
T
dingyuntian a5e417eeae feat(save): 新增梦境演出图与物品图的存档快照
新增 showcase(order 69) 与 playTool(order 70) 两个快照 section,
分别持久化 SpriteShowcase 小图/大图与 PlayToolPanel 物品图/全屏图
的终态,读档时直接还原静止画面。SpriteShowcase 与 PlayToolPanel
补充快照捕获/还原与立即清理逻辑,GameManager 在卸载场景前清理
演出效果。screen 还原顺序顺延至 80。
2026-07-18 23:59:52 +08:00

55 lines
1.7 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using System.Collections;
using UnityEngine;
namespace AibisDream.SaveSystem
{
/// <summary>
/// sections["fix"]Fix 场景宏观模式(FixSceneDirector)。
/// RestoreOrder=65,在 timeline(60) 之后、showcase(69) 之前。
/// </summary>
public class FixSnapshotProvider : IAsyncSnapshotProvider
{
public string SaveId => SnapshotProviderIds.Fix;
public int RestoreOrder => 65;
public object Capture()
{
if (!FixSceneSnapshotHelper.IsFixSceneActive())
{
return null;
}
if (FixSystem.FixSystemCenter.Instance == null)
{
Debug.LogWarning("[FixSnapshotProvider] FixSystemCenter 未初始化,跳过捕获。");
return null;
}
return FixSystem.FixSystemCenter.Instance.CaptureSnapshot();
}
public IEnumerator RestoreAsync(object dto, SnapshotRestoreContext context)
{
if (dto is not FixSnapshotDto fix)
{
context.Warn("[FixSnapshotProvider] DTO 类型不匹配,跳过还原。");
yield break;
}
if (!FixSceneSnapshotHelper.IsFixSceneActive())
{
context.Log("[FixSnapshotProvider] 当前非维修场景,跳过还原。");
yield break;
}
if (FixSystem.FixSystemCenter.Instance == null)
{
context.Warn("[FixSnapshotProvider] FixSystemCenter 未初始化,跳过还原。");
yield break;
}
yield return FixSystem.FixSystemCenter.Instance.RestoreSnapshot(fix);
}
}
}