コード例 #1
0
    //修改文本
    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);
    }
コード例 #2
0
ファイル: TextFormatRush.cs プロジェクト: moto2002/ZTGame
    //刷新文本显示 并保存
    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);
    }