using System; using System.Collections.Generic; namespace Ichni.Story { /// /// 单章节的存档容器。 /// 故事树的布局与连接完全由 静态定义,故存档不再保存 /// block 位置与连接线;进入章节时按"已完成集合 + 解锁条件"实时推导每个 block 的 /// (Completed / Current / Locked)。 /// 以单个 ES3 key 存储,按章节分文件,一次读写即可加载/保存整章进度。 /// [Serializable] public class ChapterStorySave { public string chapterIndex; // 已完成 block 的 id 列表(顺序无关,去重由 StoryTreeController 保证) public List completedBlockIds = new(); // 章节内的对话选项记录(choiceKey -> 选中项索引)。选项不跨章节引用。 public Dictionary selectedChoices = new(); } /// /// 全局剧情变量存档。float / string / bool 三类型与 Yarn Spinner 的 /// VariableStorageBehaviour.GetAllVariables/SetAllVariables 契约一致, /// 供阶段 2 的 StoryVariableStorage 直接读写。 /// [Serializable] public class StoryVariablesSave { public Dictionary floatVariables = new(); public Dictionary stringVariables = new(); public Dictionary boolVariables = new(); } }