refactor(save): 移除 Showcase 快照持久化

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-21 22:13:11 +08:00
co-authored by Cursor
parent 1547055cc2
commit 96b309992c
7 changed files with 4 additions and 247 deletions
@@ -1,36 +0,0 @@
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);
}
}
}
@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 83cccdfaca2a42a89ed515c16c6adfad
-20
View File
@@ -190,26 +190,6 @@ namespace AibisDream.SaveSystem
public string fullScreenPicName;
}
/// <summary>Showcase 当前持久化的图片类型;不包含风筝及其他瞬时演出。</summary>
public enum ShowcaseDisplayMode
{
None,
Small,
Large
}
/// <summary>sections["showcase"]:梦境 Showcase 普通小图或大图终态。</summary>
[Serializable]
public class ShowcaseSnapshotDto
{
/// <summary><see cref="ShowcaseDisplayMode"/> 枚举名。</summary>
public string displayMode;
public string picName;
/// <summary>小图是否由分层资源组成;只恢复静止画面,不恢复运动。</summary>
public bool usesSplitLayers;
}
/// <summary>sections["subway"]:地铁场景宏观状态(SubwayCenter / OutSideState)。</summary>
[Serializable]
public class SubwaySnapshotDto
@@ -16,7 +16,6 @@ namespace AibisDream.SaveSystem
public const string Timeline = "timeline";
public const string Screen = "screen";
public const string PlayTool = "playTool";
public const string Showcase = "showcase";
public const string Subway = "subway";
public const string PunchTape = "punchTape";
public const string Fix = "fix";
@@ -31,7 +30,7 @@ namespace AibisDream.SaveSystem
/// </summary>
public static readonly string[] RequiredForCapture =
{
Environment, Actor, Audio, Timeline, Subway, Fix, Showcase, PlayTool, Screen
Environment, Actor, Audio, Timeline, Subway, Fix, PlayTool, Screen
};
}
@@ -61,7 +60,6 @@ namespace AibisDream.SaveSystem
Register(new FixPanelSnapshotProvider());
Register(new BodyModuleSnapshotProvider());
Register(new EyeSnapshotProvider());
Register(new ShowcaseSnapshotProvider());
Register(new PlayToolSnapshotProvider());
Register(new ScreenSnapshotProvider());
}
@@ -257,7 +257,6 @@ namespace AibisDream.SaveSystem
SnapshotProviderIds.FixPanel => jobj.ToObject<FixPanelSnapshotDto>(),
SnapshotProviderIds.BodyModule => jobj.ToObject<BodyModuleSnapshotDto>(),
SnapshotProviderIds.Eye => jobj.ToObject<EyeSnapshotDto>(),
SnapshotProviderIds.Showcase => jobj.ToObject<ShowcaseSnapshotDto>(),
SnapshotProviderIds.PlayTool => jobj.ToObject<PlayToolSnapshotDto>(),
SnapshotProviderIds.Screen => jobj.ToObject<ScreenSnapshotDto>(),
_ => jobj