Files
FlowScope/docs/guides/main-menu-p1-sample.md
2026-05-20 16:27:08 +08:00

34 lines
1.5 KiB
Markdown
Raw Permalink 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.
# MainMenuP0 P1 样例验收
## 打开场景
在 Unity 中打开:
```text
My project/Assets/FlowScope/Samples/MainMenuP0/Scenes/MainMenuP0.unity
```
进入 Play Mode 后,`GameBootstrap` 会注册 P1 运行时服务,预加载 `MainMenuPanel`,并启动 `MainMenuFeature`
## 预期画面
画面中应出现主菜单面板、Gold 数字文本和一个递增按钮。若场景或 prefab 引用缺失,样例仍会创建运行时 fallback UI但人工验收应优先检查场景和 prefab 引用是否正确。
## Gold 递增
按钮点击调用 `MainMenuViewModel.IncrementGold`,立即修改 `PlayerData.Gold`,并通过面板订阅同步刷新 Gold 文本。点击一次后,文本应从 `0` 变为 `1`
## 保存与恢复
`ShutdownAsync` 会把 `PlayerData` 写入 `main-menu-player` 存档。再次启动样例时,`SaveService` 会读取同一 key 并恢复 Gold。
P1 样例使用 `JsonSaveSerializer` 版本 envelope旧版裸 JSON 会通过 no-op 的 1 -> 2 迁移链继续读取。
## 资源释放
样例资源通过 `ResourceService` 和样例 `IResourceBackend` 加载。`UIPreloadService` 持有预加载 handleFeature 退出时关闭面板实例Bootstrap 关闭时调用 `ReleaseAll` 释放预加载资源。
## Console 输出
验收期间不应出现未预期的 Error 或 Exception。Unity 引用版本冲突警告如果只出现在外部 `dotnet build` 中,属于当前 Unity 生成项目的已知警告,不作为样例失败条件。