尝试修改丢text的情况

This commit is contained in:
SoulliesOfficial
2025-12-14 00:51:34 -05:00
parent c260d0740c
commit e60ef64d01
12 changed files with 151 additions and 19 deletions

View File

@@ -40,6 +40,14 @@ namespace Continentis.MainGame.UI
}
TMP_Text text = textList[textIndex];
if (text == null)
{
Debug.LogWarning($"Text component at index {textIndex} is null.");
// 如果这里触发了,说明上层逻辑在尝试操作一个已经死亡的 UI 对象
return;
}
if (getText != null)
{
text.gameObject.SetActive(true);