Exemplo n.º 1
0
 public static void SetTextWithColor(this UITextmesh self, string text, string colorstr)
 {
     if (string.IsNullOrEmpty(colorstr))
     {
         self.SetText(text);
     }
     else
     {
         if (!colorstr.StartsWith("#"))
         {
             colorstr = "#" + colorstr;
         }
         self.SetText($"<color={colorstr}>{text}</color>");
     }
 }
Exemplo n.º 2
0
 public static void SetI18NKey(this UITextmesh self, string key, params object[] paras)
 {
     if (string.IsNullOrEmpty(key))
     {
         self.SetText("");
         return;
     }
     self.__DisableI18Component();
     self.__text_key = key;
     self.SetI18NText(paras);
 }