暂停功能实现

This commit is contained in:
2024-10-16 15:24:42 +08:00
parent 5bac5ba7a8
commit e869e5e43f
4 changed files with 88 additions and 34 deletions
@@ -13,7 +13,7 @@ namespace AibisDream
public class DialogController : Singleton<DialogController>
{
private const string BookManager = "BookManager";
private DialogueRunner dialogueRunner;
private VariableStorageBehaviour _variableStorage;
@@ -45,6 +45,10 @@ namespace AibisDream
public bool IsBlock { get; private set; }
public bool quickRunMode;
// 暂停对话
private bool _isInPause;
private Action _pauseNextStep;
# endregion
@@ -108,6 +112,30 @@ namespace AibisDream
dialogueRunner.StartDialogue("Start");
}
/// <summary>
/// 继续对话
/// </summary>
public bool TryContinueTalk()
{
// 如果对话系统在暂停状态
if (_isInPause)
{
_pauseNextStep.Invoke();
_isInPause = false;
_pauseNextStep = null;
return true;
}
// 如果对话系统不在暂停状态
return false;
}
public void PauseTalk(Action pauseNextStep)
{
_isInPause = true;
_pauseNextStep = pauseNextStep;
}
/// <summary>
/// 调用命令
/// </summary>