暂停功能实现
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user