25 lines
683 B
C#
25 lines
683 B
C#
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();
|
|
}
|
|
}
|
|
}
|