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