fix: 气泡时序问题

This commit is contained in:
2026-07-22 00:07:54 +08:00
parent 3891b6bd37
commit 3919ea9a75
7 changed files with 57 additions and 10 deletions
+9 -4
View File
@@ -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();
}
}
}
}