对话框
This commit is contained in:
@@ -18,18 +18,12 @@ namespace AibisDream
|
||||
private Action _nextStep;
|
||||
|
||||
#endregion
|
||||
|
||||
private bool _skipLineDelay;
|
||||
|
||||
private TextParam _textParam;
|
||||
|
||||
[Header("跳过阻塞延迟时间/ms")] [SerializeField]
|
||||
private int delayTime = 300;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
InitComponents();
|
||||
AddSomeListener();
|
||||
}
|
||||
|
||||
private void InitComponents()
|
||||
@@ -37,16 +31,6 @@ namespace AibisDream
|
||||
_dialogText = transform.Find("Dialog Text")?.gameObject.GetComponent<TypewriterByCharacter>();
|
||||
}
|
||||
|
||||
private void AddSomeListener()
|
||||
{
|
||||
// 对话显示后有一段延时不可跳过
|
||||
_dialogText.onTypewriterStart.AddListener(() =>
|
||||
{
|
||||
_skipLineDelay = true;
|
||||
_ = CommonUtil.Delay(delayTime, () => { _skipLineDelay = false; });
|
||||
});
|
||||
}
|
||||
|
||||
public void ShowLine(string dialogLine, CharacterVo character, Action nextStep, string lineId, bool isAutoSkip = false)
|
||||
{
|
||||
// 把原有对话清掉
|
||||
@@ -75,11 +59,6 @@ namespace AibisDream
|
||||
|
||||
public bool TrySkipLine(bool isForceSkip)
|
||||
{
|
||||
if (_skipLineDelay && !isForceSkip)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (_dialogText.isShowingText)
|
||||
{
|
||||
_dialogText.SkipTypewriter();
|
||||
|
||||
Reference in New Issue
Block a user