docs(save): 更新 SaveSystem README
同步 README 目录结构: - 反映已合并的 P1 文件(SaveSnapshotSummary、SnapshotBootstrap 等) - 补充 P2 新增文件(SlotTypes、SlotFileSystem、SlotManager、CloudSave) - 更新 Provider 注册与 section 反序列化指引
This commit is contained in:
@@ -38,20 +38,23 @@ P1 测试落盘路径:`persistentDataPath/AllOurBrokenParts/snapshot_test/late
|
||||
SaveSystem/
|
||||
├── README.md ← 本文件
|
||||
├── ISnapshotProvider.cs 契约:Capture / Restore(P1 临时形态,见下)
|
||||
├── SaveSnapshot.cs 快照根对象 + 各 section DTO
|
||||
├── SnapshotProviderIds.cs section 稳定 id("actor" 等)
|
||||
├── SnapshotRegistry.cs provider 注册表
|
||||
├── SnapshotBootstrap.cs 启动时注册 6 个 provider
|
||||
├── SaveSnapshot.cs 快照根对象 + 各 section DTO + SaveSnapshotSummary
|
||||
├── SnapshotRegistry.cs provider 稳定 id、注册表、启动注册
|
||||
├── SnapshotCapture.cs 组装 SaveSnapshot(scene / anchor 由框架直管)
|
||||
├── SnapshotRestore.cs 写回运行时(scene / anchor 由框架直管)
|
||||
├── SnapshotRestore.cs 写回运行时;含 section JObject → 强类型转换
|
||||
├── SnapshotService.cs Capture / Restore 对外 API
|
||||
├── SnapshotPersistence.cs 文件读写、旧档检测
|
||||
├── SnapshotSerializer.cs JSON + schemaVersion
|
||||
├── SnapshotSectionDeserializer.cs JObject → 强类型 DTO
|
||||
├── SnapshotPersistence.cs 文件读写、JSON 序列化、旧档检测
|
||||
├── SaveRestoreOrchestrator.cs UI + 落盘 + 读盘编排
|
||||
├── DeepRepairSnapshot.cs 深度维修占位(P5)
|
||||
├── DeepRepairDataRegistry.cs 旧 IData 容器(P5 前)
|
||||
├── ScreenSnapshotHelper.cs screen section 实现细节
|
||||
├── SlotTypes.cs P2:槽位常量、sidecar、UI 视图模型
|
||||
├── SlotFileSystem.cs P2:槽位路径 + 原子写
|
||||
├── SlotManager.cs P2:槽位业务核心
|
||||
├── SlotThumbnailCapture.cs P2:截图 helper
|
||||
├── CloudSave/ P2:云存档适配器接口与协调器
|
||||
│ ├── ICloudSaveBackend.cs
|
||||
│ └── CloudSaveManager.cs
|
||||
└── Providers/ 表现层子系统薄适配层
|
||||
├── EnvironmentSnapshotProvider.cs order 20
|
||||
├── ActorSnapshotProvider.cs order 40
|
||||
@@ -136,11 +139,11 @@ Phase 4 P4:淡入淡出等演出时序
|
||||
表现层子系统通过 Provider 注册到 `sections`:
|
||||
|
||||
1. 在 `SaveSnapshot.cs` 增加 DTO 类。
|
||||
2. 在 `SnapshotProviderIds` 增加稳定 id,并加入 `RequiredForCapture`(若 P1 必须存)。
|
||||
2. 在 `SnapshotRegistry.cs` 的 `SnapshotProviderIds` 区域增加稳定 id,并加入 `RequiredForCapture`(若 P1 必须存)。
|
||||
3. 在对应 Manager 实现 `CaptureSnapshot` / `RestoreSnapshot`(**默认 sync `void`**;仅确有 async 加载/状态切换时用 `IEnumerator` 并向编排层上报)。
|
||||
4. 新建 `Providers/XxxSnapshotProvider.cs` 实现 `ISnapshotProvider`(P4 后:sync 默认 + 显式 async 接口)。
|
||||
5. 在 `SnapshotBootstrap.EnsureInitialized` 中 `Register`。
|
||||
6. 在 `SnapshotSectionDeserializer.Coerce` 增加 JObject 转换分支。
|
||||
5. 在 `SnapshotRegistry.EnsureInitialized` 中 `Register`。
|
||||
6. 在 `SnapshotRestore.CoerceSectionDto` 增加 JObject 转换分支。
|
||||
|
||||
**禁止**在 Provider 内私自 `StartCoroutine` 而不纳入编排 Barrier。
|
||||
|
||||
@@ -169,7 +172,7 @@ Fix 场景各 State 的 `Enter()` 通常包含相机过渡、Timeline 播放、F
|
||||
- `IFixState` 接口 + `EnterImmediate()` 默认实现
|
||||
- `FixStateMachine.SwitchStateImmediate()`
|
||||
- `FixSystemCenter.CaptureSnapshot()` / `RestoreSnapshot()`
|
||||
- `FixSnapshotProvider` 注册到 `SnapshotBootstrap`
|
||||
- `FixSnapshotProvider` 注册到 `SnapshotRegistry.EnsureInitialized`
|
||||
|
||||
### 尚未实现(P4/P5)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user