新增 showcase(order 69) 与 playTool(order 70) 两个快照 section, 分别持久化 SpriteShowcase 小图/大图与 PlayToolPanel 物品图/全屏图 的终态,读档时直接还原静止画面。SpriteShowcase 与 PlayToolPanel 补充快照捕获/还原与立即清理逻辑,GameManager 在卸载场景前清理 演出效果。screen 还原顺序顺延至 80。
37 lines
1.2 KiB
C#
37 lines
1.2 KiB
C#
using System.Collections;
|
|
|
|
namespace AibisDream.SaveSystem
|
|
{
|
|
/// <summary>sections["showcase"]:梦境普通小图或大图。RestoreOrder=69。</summary>
|
|
public sealed class ShowcaseSnapshotProvider : IAsyncSnapshotProvider
|
|
{
|
|
public string SaveId => SnapshotProviderIds.Showcase;
|
|
public int RestoreOrder => 69;
|
|
|
|
public object Capture()
|
|
{
|
|
return SpriteShowcase.Instance != null
|
|
? SpriteShowcase.Instance.CaptureSnapshot()
|
|
: null;
|
|
}
|
|
|
|
public IEnumerator RestoreAsync(object dto, SnapshotRestoreContext context)
|
|
{
|
|
if (dto is not ShowcaseSnapshotDto snapshot)
|
|
{
|
|
context.Warn("[ShowcaseSnapshotProvider] DTO 类型不匹配,跳过还原。");
|
|
yield break;
|
|
}
|
|
|
|
var showcase = SpriteShowcase.Instance;
|
|
if (showcase == null)
|
|
{
|
|
context.Warn("[ShowcaseSnapshotProvider] SpriteShowcase 未初始化,跳过还原。");
|
|
yield break;
|
|
}
|
|
|
|
yield return showcase.RestoreSnapshotAsync(snapshot, context.Warn);
|
|
}
|
|
}
|
|
}
|