feat(save-system): 新增 Yarn <<save>> 显式存档与测试归档模式
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user