//修改文本 private void changeTextStyle() { MTextFormatData data = TextFormatDefine.GetFormat(style); text.color = data.color; text.fontSize = data.fontSize; outline.enabled = data.isOutline; outline.effectColor = data.effectColor; EditorUtility.SetDirty(outline); EditorUtility.SetDirty(text); }
//刷新文本显示 并保存 private static void rushText(Transform item, string style, string textKey) { UnityEngine.UI.Text txt = item.GetComponentInChildren <UnityEngine.UI.Text>(); Outline outline = item.GetComponentInChildren <Outline>(); txt.text = LocalString.GetWord(textKey); MTextFormatData data = TextFormatDefine.GetFormat(style); txt.color = data.color; txt.fontSize = data.fontSize; outline.enabled = data.isOutline; outline.effectColor = data.effectColor; EditorUtility.SetDirty(outline); EditorUtility.SetDirty(txt); }