/// <summary>
    /// Convenience function -- mark all widgets using the sprite as changed.
    /// </summary>

    void MarkSpriteAsDirty()
    {
        if (mSprite == null)
        {
            return;
        }

        NGUISprite[] sprites = NGUITools.FindActive <NGUISprite>();

        foreach (NGUISprite sp in sprites)
        {
            if (sp.spriteName == mSprite.name)
            {
                sp.atlas = null;
                sp.atlas = mAtlas;
                EditorUtility.SetDirty(sp);
            }
        }

        NGUILabel[] labels = NGUITools.FindActive <NGUILabel>();

        foreach (NGUILabel lbl in labels)
        {
            if (lbl.font != null && NGUIAtlas.CheckIfRelated(lbl.font.atlas, mAtlas) && lbl.font.UsesSprite(mSprite.name))
            {
                NGUIFont font = lbl.font;
                lbl.font = null;
                lbl.font = font;
                EditorUtility.SetDirty(lbl);
            }
        }
    }