暂停功能

This commit is contained in:
2024-10-16 20:28:07 +08:00
parent e869e5e43f
commit 6b334ce47d
6 changed files with 132 additions and 126 deletions
+38 -2
View File
@@ -1,6 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Yarn.Unity;
@@ -69,5 +67,43 @@ namespace AibisDream
return yarnOptions;
}
}
public class YarnContinueStep
{
private Action _nextStep;
public YarnContinueStep(Action nextStep)
{
_nextStep = nextStep;
}
/// <summary>
/// 继续对话
/// </summary>
public void ContinueTalk()
{
if (_nextStep != null)
{
_nextStep.Invoke();
DialogController.Instance.isInPause = false;
_nextStep = null;
}
else
{
Debug.LogWarning("对话已经继续,请勿重复触发");
}
}
/// <summary>
/// 生成继续命令
/// </summary>
/// <param name="nextStep">下一句命令</param>
/// <returns>命令</returns>
public static YarnContinueStep GeneContinueStep(Action nextStep)
{
DialogController.Instance.isInPause = true;
return new YarnContinueStep(nextStep);
}
}
}