public static void SetI18NKey(this UIText self, string key) { if (string.IsNullOrEmpty(key)) { self.SetText(""); return; } self.__DisableI18Component(); self.__text_key = key; self.SetI18NText(null); }
public static void SetI18NText(this UIText self, params object[] paras) { if (string.IsNullOrEmpty(self.__text_key)) { Log.Error("there is not key "); } else { self.__DisableI18Component(); self.keyParams = paras; if (I18NComponent.Instance.I18NTryGetText(self.__text_key, out var text) && paras != null) { text = string.Format(text, paras); } self.unity_uitext.text = text; } }
public static void SetText(this UIText self, string text) { self.__DisableI18Component(); self.__text_key = null; self.unity_uitext.text = text; }