Merge branch 'develop' into feature/开发模式

This commit is contained in:
2026-07-23 13:47:17 +08:00
533 changed files with 22396 additions and 13346 deletions
@@ -0,0 +1,35 @@
using System.Collections;
namespace AibisDream.SaveSystem
{
/// <summary>sections["day2SleepPresentation"]D2 Sleep 动态表现语义终态。</summary>
public sealed class Day2SleepPresentationSnapshotProvider : IAsyncSnapshotProvider
{
public string SaveId => SnapshotProviderIds.Day2SleepPresentation;
public int RestoreOrder => 70;
public object Capture()
{
var controller = Day2SleepPresentationController.Instance;
return controller != null && controller.HasPersistableState
? controller.CaptureSnapshot()
: null;
}
public IEnumerator RestoreAsync(object dto, SnapshotRestoreContext context)
{
if (dto is not Day2SleepPresentationSnapshotDto snapshot)
{
context.Warn("[Day2SleepPresentationSnapshotProvider] DTO 类型不匹配,跳过还原。");
yield break;
}
var controller = Day2SleepPresentationController.Instance;
if (controller == null)
{
context.Warn("[Day2SleepPresentationSnapshotProvider] 控制器未初始化,跳过还原。");
yield break;
}
yield return controller.RestoreSnapshotAsync(snapshot, context.Warn);
}
}
}
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 8f80937eaaba42da9baa4a2d8e73ff57
@@ -3,11 +3,11 @@ using AibisDream.UI;
namespace AibisDream.SaveSystem
{
/// <summary>sections["playTool"]:物品图与全屏图。RestoreOrder=70。</summary>
/// <summary>sections["playTool"]:物品图与全屏图。RestoreOrder=71。</summary>
public sealed class PlayToolSnapshotProvider : IAsyncSnapshotProvider
{
public string SaveId => SnapshotProviderIds.PlayTool;
public int RestoreOrder => 70;
public int RestoreOrder => 71;
public object Capture()
{
@@ -2,7 +2,7 @@ using System.Collections;
namespace AibisDream.SaveSystem
{
/// <summary>sections["showcase"]:梦境普通小图或大图。RestoreOrder=69。</summary>
/// <summary>sections["showcase"]:梦境通用静态图片;先于场景专属表现恢复。</summary>
public sealed class ShowcaseSnapshotProvider : IAsyncSnapshotProvider
{
public string SaveId => SnapshotProviderIds.Showcase;
@@ -22,14 +22,12 @@ namespace AibisDream.SaveSystem
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);
}
}
+6 -5
View File
@@ -1,4 +1,4 @@
# SaveSystem 存档快照层
# SaveSystem 存档快照层
> 当前代码包含 P1 快照层、P2 槽位/落盘基础版、P3 可存点判定基础版、P4 读档编排基础版。设计文档见 [`Docs/存档系统设计方案.md`](../../../Docs/存档系统设计方案.md)**§4.1 / D6** 描述读档编排模型)。
@@ -67,7 +67,7 @@ Yarn 脚本:
逻辑集中在 `SavePointEvaluator.cs`**不新增**独立 Tracker 文件。
正式槽位路径:`persistentDataPath/AllOurBrokenParts/saves/slot_x/{snapshot.json, meta.json, thumbnail.png}`
正式槽位路径:`persistentDataPath/AllOurBrokenParts/demo_saves/slot_x/{snapshot.json, meta.json, thumbnail.png}`
P1 测试落盘路径:`persistentDataPath/AllOurBrokenParts/snapshot_test/latest_snapshot.json`(首次访问槽位系统时会尝试迁移到 `slot_0`
@@ -101,7 +101,8 @@ SaveSystem/
├── FixSnapshotProvider.cs order 65
├── FixPanelSnapshotProvider.cs order 66
├── ShowcaseSnapshotProvider.cs order 69
├── PlayToolSnapshotProvider.cs order 70
├── Day2SleepPresentationSnapshotProvider.cs order 70
├── PlayToolSnapshotProvider.cs order 71
└── ScreenSnapshotProvider.cs order 80
```
@@ -135,7 +136,7 @@ Phase 0 Yarn 变量(sync
Phase 1 场景加载(BarrierLoadSceneAsync)← 框架直管,不走 Provider
Phase 2 env / actor / audio / timeline / fix / showcase / playTool / screenProvider 按 RestoreOrder
Phase 2 env / actor / audio / timeline / fix / showcase / day2SleepPresentation / playTool / screenProvider 按 RestoreOrder
└─ timeline`Stopped` = untouched(从未 Evaluate),读档仅还原 `isActive`,不 Reset/Evaluate
Phase 2 可选 Barrier(如 Timeline Addressable 须显式等待)
@@ -202,7 +203,7 @@ Fix 场景各 State 的 `Enter()` 通常包含相机过渡、Timeline 播放、F
| `bodyModule` | `BodyModuleSnapshotDto` | 67 | 插线模块物理态 |
| `eye` | `EyeSnapshotDto` | 68 | Eye 叙事阶段 |
**还原顺序**punchTape → fixcue)→ fixPanel → bodyModule → eye → showcase → playTool → screen。`fixPanel` 须在 `fix` 之后,以覆盖 Cue `EnterImmediate` 中的 `ResetPlug`
**还原顺序**punchTape → fixcue)→ fixPanel → bodyModule → eye → showcase → day2SleepPresentation → playTool → screen。`fixPanel` 须在 `fix` 之后,以覆盖 Cue `EnterImmediate` 中的 `ResetPlug`;D2 动态表现须在通用 Showcase 图片之后恢复,才能叠加虚焦、缩放或场景专属动画
**维修场景门控**`FixSceneSnapshotHelper`):上述 section 仅在 `FixSystemCenter.Instance != null` 时 Capture/Restore。
+32 -5
View File
@@ -190,7 +190,6 @@ namespace AibisDream.SaveSystem
public string fullScreenPicName;
}
/// <summary>Showcase 当前持久化的图片类型;不包含风筝及其他瞬时演出。</summary>
public enum ShowcaseDisplayMode
{
None,
@@ -198,16 +197,44 @@ namespace AibisDream.SaveSystem
Large
}
/// <summary>sections["showcase"]:梦境 Showcase 普通小图或大图终态。</summary>
/// <summary>sections["showcase"]:梦境通用静态图片与背景终态。</summary>
[Serializable]
public class ShowcaseSnapshotDto
{
/// <summary><see cref="ShowcaseDisplayMode"/> 枚举名。</summary>
public string displayMode;
public string picName;
public bool isBackgroundVisible;
}
/// <summary>小图是否由分层资源组成;只恢复静止画面,不恢复运动。</summary>
public bool usesSplitLayers;
public enum Day2SleepPresentationMode
{
None,
SmallMotion,
Kite,
LargeEffects
}
/// <summary>sections["day2SleepPresentation"]D2 Sleep 动态表现语义终态。</summary>
[Serializable]
public class Day2SleepPresentationSnapshotDto
{
public string mode;
public string picName;
public string motionProfile;
public float kiteHeight;
public int kiteWind;
public float kiteTurbulence;
public bool largeAnimationActive;
public string largeAnimationPrefix;
public int largeAnimationFrameCount;
public float largeAnimationSecondsPerFrame;
public float largeBlurAmount;
public float largeBlurSize;
public float largeScaleMultiplier = 1f;
public float largeAlpha = 1f;
}
/// <summary>sections["subway"]:地铁场景宏观状态(SubwayCenter / OutSideState)。</summary>
@@ -17,6 +17,7 @@ namespace AibisDream.SaveSystem
public const string Screen = "screen";
public const string PlayTool = "playTool";
public const string Showcase = "showcase";
public const string Day2SleepPresentation = "day2SleepPresentation";
public const string Subway = "subway";
public const string PunchTape = "punchTape";
public const string Fix = "fix";
@@ -62,6 +63,7 @@ namespace AibisDream.SaveSystem
Register(new BodyModuleSnapshotProvider());
Register(new EyeSnapshotProvider());
Register(new ShowcaseSnapshotProvider());
Register(new Day2SleepPresentationSnapshotProvider());
Register(new PlayToolSnapshotProvider());
Register(new ScreenSnapshotProvider());
}
@@ -258,6 +258,7 @@ namespace AibisDream.SaveSystem
SnapshotProviderIds.BodyModule => jobj.ToObject<BodyModuleSnapshotDto>(),
SnapshotProviderIds.Eye => jobj.ToObject<EyeSnapshotDto>(),
SnapshotProviderIds.Showcase => jobj.ToObject<ShowcaseSnapshotDto>(),
SnapshotProviderIds.Day2SleepPresentation => jobj.ToObject<Day2SleepPresentationSnapshotDto>(),
SnapshotProviderIds.PlayTool => jobj.ToObject<PlayToolSnapshotDto>(),
SnapshotProviderIds.Screen => jobj.ToObject<ScreenSnapshotDto>(),
_ => jobj
+1 -1
View File
@@ -10,7 +10,7 @@ namespace AibisDream.SaveSystem
{
/// <summary>
/// 测试存档模式:每次自动存档写入 <see cref="ConstRef.TestAutoSaveArchivePath"/> 下的独立子目录。
/// 开启后不写入 slot_0,存多少次就保留多少份,与正式 saves/ 完全隔离。
/// 开启后不写入 slot_0,存多少次就保留多少份,与正式 demo_saves/ 完全隔离。
/// </summary>
public static class TestSaveArchive
{