暂停功能

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
@@ -9,10 +9,6 @@ namespace AibisDream
// 进入指令选项模式
private bool _waitCommandOptions;
private string _commandName;
// 进入暂停后
private bool _isInPause;
private Action _pauseNextStep;
public override void RunLine(LocalizedLine dialogueLine, Action onDialogueLineFinished)
{
@@ -58,13 +54,17 @@ namespace AibisDream
switch (commandLineType)
{
case CommandLineType.Pause:
DialogController.Instance.PauseTalk(onDialogueLineFinished);
// 获取选项名称
dialogueLine.Text.TryGetPauseCommandAttr(out var pauseCommandName);
// 传递暂停指令
var step = YarnContinueStep.GeneContinueStep(onDialogueLineFinished);
DialogController.Instance.InvokePauseCommand(pauseCommandName, step);
break;
case CommandLineType.OptionCommand:
// 选项指令
_waitCommandOptions = true;
dialogueLine.Text.TryGetCommandAttr(out var curCommandName);
dialogueLine.Text.TryGetOptionCommandAttr(out var curCommandName);
// 保存指令
_commandName = curCommandName;
// 进入下一步
@@ -73,6 +73,7 @@ namespace AibisDream
case CommandLineType.NonCommand:
default:
// 非Command直接跳过
_waitCommandOptions = false;
base.RunLine(dialogueLine, onDialogueLineFinished);
break;
}