fix: 气泡时序问题
This commit is contained in:
@@ -24,6 +24,13 @@ namespace AibisDream
|
||||
// 先中断结束事件
|
||||
_autoHideToken?.Cancel();
|
||||
_autoHideToken = null;
|
||||
OnTextShowed = null;
|
||||
|
||||
// 先停止旧动画并准备好激活状态,避免 OnEnable 或旧动画完成事件命中新 token。
|
||||
content.StopShowingText();
|
||||
box.SetActive(true);
|
||||
content.StopShowingText();
|
||||
content.TextAnimator.SetText(string.Empty);
|
||||
|
||||
// 注册事件
|
||||
OnTextShowed += syncToken.TextShown;
|
||||
@@ -31,10 +38,8 @@ namespace AibisDream
|
||||
syncToken.OnAdvance += AfterAdvance;
|
||||
|
||||
// 播放文字
|
||||
content.TextAnimator.SetText(string.Empty);
|
||||
box.SetActive(true);
|
||||
content.ShowText(syncToken.lineInfo.lineText);
|
||||
syncToken.TextStart();
|
||||
content.ShowText(syncToken.lineInfo.lineText);
|
||||
}
|
||||
|
||||
private async void AfterAdvance()
|
||||
@@ -109,4 +114,4 @@ namespace AibisDream
|
||||
HideDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user