From a2f231014b639a0fe89f55d2f75b1181daf3491d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=80=9D=E6=B5=B7?= <1464576565@qq.com> Date: Mon, 7 Apr 2025 13:56:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Runtime/UGUIExtension/Text/UXTextMeshPro.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Runtime/UGUIExtension/Text/UXTextMeshPro.cs b/Runtime/UGUIExtension/Text/UXTextMeshPro.cs index bbacc53..7889e6f 100644 --- a/Runtime/UGUIExtension/Text/UXTextMeshPro.cs +++ b/Runtime/UGUIExtension/Text/UXTextMeshPro.cs @@ -6,6 +6,7 @@ namespace UnityEngine.UI public class UXTextMeshPro : TextMeshProUGUI { [SerializeField] private string m_localizationID = ""; + protected override void Start() { base.Start(); @@ -15,7 +16,7 @@ namespace UnityEngine.UI protected void ChangeLanguage() { - if (!string.IsNullOrEmpty(m_localizationID) && !"None".Equals(m_localizationID)) + if (!string.IsNullOrEmpty(m_localizationID) && !"None".Equals(m_localizationID) && GameApp.Localization != null) { text = GameApp.Localization?.GetString(m_localizationID); }