UIFont.MarkAsDirty C# (CSharp) Méthode

MarkAsDirty() public méthode

Refresh all labels that use this font.
public MarkAsDirty ( ) : void
Résultat void
    public void MarkAsDirty()
    {
        #if UNITY_EDITOR
        UnityEditor.EditorUtility.SetDirty(gameObject);
        #endif
        if (mReplacement != null) mReplacement.MarkAsDirty();

        mSprite = null;
        UILabel[] labels = NGUITools.FindActive<UILabel>();

        for (int i = 0, imax = labels.Length; i < imax; ++i)
        {
            UILabel lbl = labels[i];

            if (lbl.enabled && NGUITools.GetActive(lbl.gameObject) && CheckIfRelated(this, lbl.font))
            {
                UIFont fnt = lbl.font;
                lbl.font = null;
                lbl.font = fnt;
            }
        }

        // Clear all symbols
        for (int i = 0, imax = mSymbols.Count; i < imax; ++i)
            symbols[i].MarkAsDirty();
    }

Usage Example

Exemple #1
0
    /// <summary>
    /// Refresh all labels that use this font.
    /// </summary>

    public void MarkAsDirty()
    {
#if UNITY_EDITOR
        UnityEditor.EditorUtility.SetDirty(gameObject);
#endif
        if (mReplacement != null)
        {
            mReplacement.MarkAsDirty();
        }

        mSprite = null;
        UILabel[] labels = NGUITools.FindActive <UILabel>();

        for (int i = 0, imax = labels.Length; i < imax; ++i)
        {
            UILabel lbl = labels[i];

            if (lbl.enabled && NGUITools.GetActive(lbl.gameObject) && CheckIfRelated(this, lbl.font))
            {
                UIFont fnt = lbl.font;
                lbl.font = null;
                lbl.font = fnt;
            }
        }

        // Clear all symbols
        for (int i = 0, imax = mSymbols.Count; i < imax; ++i)
        {
            symbols[i].MarkAsDirty();
        }
    }
All Usage Examples Of UIFont::MarkAsDirty