25 lines
680 B
C#
25 lines
680 B
C#
using System.Collections;
|
|
using UnityEngine;
|
|
using Yarn.Unity;
|
|
|
|
namespace AibisDream.SaveSystem
|
|
{
|
|
/// <summary>
|
|
/// Yarn 显式存档兼容命令。新内容应使用 interaction 一级类型或 save_on_exit 附加标记。
|
|
/// </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();
|
|
}
|
|
}
|
|
}
|