Beispiel #1
0
 public static void OnLanguageChange(this UIText self)
 {
     self.ActivatingComponent();
     {
         if (I18NComponent.Instance.I18NTryGetText(self.__text_key, out var text) && self.keyParams != null)
         {
             text = string.Format(text, self.keyParams);
         }
         self.unity_uitext.text = text;
     }
 }
Beispiel #2
0
 //当手动修改text的时候,需要将mono的i18textcomponent给禁用掉
 static void __DisableI18Component(this UIText self, bool enable = false)
 {
     self.ActivatingComponent();
     if (self.unity_i18ncomp_touched != null)
     {
         self.unity_i18ncomp_touched.enabled = enable;
         if (!enable)
         {
             Log.Warning($"组件{self.GetGameObject().name}, text在逻辑层进行了修改,所以应该去掉去预设里面的I18N组件,否则会被覆盖");
         }
     }
 }
Beispiel #3
0
 public static string GetText(this UIText self)
 {
     self.ActivatingComponent();
     return(self.unity_uitext.text);
 }
Beispiel #4
0
 public static void SetTextColor(this UIText self, Color color)
 {
     self.ActivatingComponent();
     self.unity_uitext.color = color;
 }