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>"); } }
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); }