fix(ui): 修复单行对话框未激活时空引用
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -39,10 +39,13 @@ namespace AibisDream
|
||||
syncToken.SkipTextAnima += () => content.SkipTypewriter();
|
||||
syncToken.OnAdvance += AfterAdvance;
|
||||
|
||||
// TMP ClearMesh 依赖 canvasRenderer;box 未激活时 SetText 会 NRE
|
||||
if (box != null && !box.activeSelf)
|
||||
box.SetActive(true);
|
||||
|
||||
// 播放文字
|
||||
content.TextAnimator.SetText(string.Empty);
|
||||
var lineText = GetOneLineText(syncToken.lineInfo);
|
||||
box.SetActive(true);
|
||||
HandleLayout(lineText);
|
||||
content.ShowText(lineText);
|
||||
syncToken.TextStart();
|
||||
|
||||
Reference in New Issue
Block a user