Skip to content

Commit bc0f266

Browse files
authored
LocalizationText获取Text
1 parent 7f592e9 commit bc0f266

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

GameFramework/Runtime/Localization/LocalizationText.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,15 @@ public string Text
3636

3737
private void Start()
3838
{
39-
_uiText = GetComponent<Text>();
4039
SetUIText(_text);
4140
}
4241

4342
private void SetUIText(string key)
4443
{
44+
if(_uiText = null)
45+
{
46+
_uiText = GetComponent<Text>();
47+
}
4548
_uiText.text = GameFrameworkMode.GetModule<LocalizationManager>().Get(key);
4649
}
4750

0 commit comments

Comments
 (0)