Storyline+Dialog初步

This commit is contained in:
SoulliesOfficial
2026-07-05 16:08:23 -04:00
parent afa8a56e1d
commit d031afd075
464 changed files with 25716 additions and 4209 deletions

View File

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