feat(save-system): 新增 Yarn <<save>> 显式存档与测试归档模式

This commit is contained in:
2026-06-24 22:45:00 +08:00
parent e90da7bab7
commit 5a0b7a047b
8 changed files with 372 additions and 47 deletions
@@ -0,0 +1,24 @@
using System.Collections;
using UnityEngine;
using Yarn.Unity;
namespace AibisDream.SaveSystem
{
/// <summary>
/// Yarn 显式存档命令。在节点末尾、状态命令执行完毕且即将进入无对话阶段时使用。
/// </summary>
public static class SaveYarnCommand
{
[YarnCommand("save")]
public static IEnumerator Save()
{
if (!SavePointEvaluator.CanExplicitSave(out var reason))
{
Debug.LogWarning($"[SaveYarnCommand] <<save>> 被拒绝: {reason}");
yield break;
}
yield return SaveRestoreOrchestrator.ExplicitSaveRoutine();
}
}
}