/// <summary>
/// Convenience function -- mark all widgets using the sprite as changed.
/// </summary>
void MarkSpriteAsDirty()
{
if (mSprite == null)
{
return;
}
UISprite[] sprites = NGUITools.FindActive <UISprite>();
foreach (UISprite sp in sprites)
{
if (sp.spriteName == mSprite.name)
{
sp.atlas = null;
sp.atlas = mAtlas;
EditorUtility.SetDirty(sp);
}
}
UILabel[] labels = NGUITools.FindActive <UILabel>();
foreach (UILabel lbl in labels)
{
if (lbl.font != null && UIAtlas.CheckIfRelated(lbl.font.atlas, mAtlas) && lbl.font.spriteName == mSprite.name)
{
UIBaseFont font = lbl.font;
lbl.font = null;
lbl.font = font;
EditorUtility.SetDirty(lbl);
}
}
}