Storyline+Dialog初步
This commit is contained in:
37
Assets/Scripts/NewStorySystem/Save/StorySave.cs
Normal file
37
Assets/Scripts/NewStorySystem/Save/StorySave.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user