UI系统优化

This commit is contained in:
2026-05-25 11:54:37 +08:00
parent c7057db27d
commit 3c812cfb41
130 changed files with 4738 additions and 477 deletions

View File

@@ -90,7 +90,7 @@ namespace BaseGames.Dialogue
bool hasSpeaker = !string.IsNullOrEmpty(resolvedNameKey);
if (_speakerNamePanel != null) _speakerNamePanel.SetActive(hasSpeaker);
if (hasSpeaker && _speakerNameText != null)
_speakerNameText.text = LocalizationManager.Get(resolvedNameKey, "Dialogue");
_speakerNameText.text = LocalizationManager.Get(resolvedNameKey, LocalizationTable.Dialogue);
// 说话人名称框背景颜色accentColor有 actor 时着色,无 actor 时还原默认色
if (_speakerNameBackground != null)
@@ -145,7 +145,7 @@ namespace BaseGames.Dialogue
}
else
{
_dialogueText.text = LocalizationManager.Get(key, "Dialogue");
_dialogueText.text = LocalizationManager.Get(key, LocalizationTable.Dialogue);
}
}
IsTyping = false;
@@ -200,7 +200,7 @@ namespace BaseGames.Dialogue
var (go, btn, lbl) = _choicePool[i];
go.SetActive(true);
if (lbl != null)
lbl.text = LocalizationManager.Get(choices[i].textKey ?? "", "Dialogue");
lbl.text = LocalizationManager.Get(choices[i].textKey ?? "", LocalizationTable.Dialogue);
if (btn != null)
{
btn.onClick.RemoveAllListeners();
@@ -253,7 +253,7 @@ namespace BaseGames.Dialogue
}
else
{
text = LocalizationManager.Get(line.textKey, "Dialogue");
text = LocalizationManager.Get(line.textKey, LocalizationTable.Dialogue);
}
// 复用缓存 StringBuilder避免每行 new 分配TMP SetText(StringBuilder) 零分配