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.SkipTextAnima += () => content.SkipTypewriter();
|
||||||
syncToken.OnAdvance += AfterAdvance;
|
syncToken.OnAdvance += AfterAdvance;
|
||||||
|
|
||||||
|
// TMP ClearMesh 依赖 canvasRenderer;box 未激活时 SetText 会 NRE
|
||||||
|
if (box != null && !box.activeSelf)
|
||||||
|
box.SetActive(true);
|
||||||
|
|
||||||
// 播放文字
|
// 播放文字
|
||||||
content.TextAnimator.SetText(string.Empty);
|
content.TextAnimator.SetText(string.Empty);
|
||||||
var lineText = GetOneLineText(syncToken.lineInfo);
|
var lineText = GetOneLineText(syncToken.lineInfo);
|
||||||
box.SetActive(true);
|
|
||||||
HandleLayout(lineText);
|
HandleLayout(lineText);
|
||||||
content.ShowText(lineText);
|
content.ShowText(lineText);
|
||||||
syncToken.TextStart();
|
syncToken.TextStart();
|
||||||
|
|||||||
Reference in New Issue
Block a user