对话框

This commit is contained in:
2025-06-04 21:45:50 +08:00
parent c468c8b070
commit f14cdf90f6
37 changed files with 1129 additions and 966 deletions
-21
View File
@@ -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();