UIAtlas.CheckIfRelated C# (CSharp) Method

CheckIfRelated() static public method

Helper function that determines whether the two atlases are related.
static public CheckIfRelated ( UIAtlas, a, UIAtlas, b ) : bool
a UIAtlas,
b UIAtlas,
return bool
	static public bool CheckIfRelated (UIAtlas a, UIAtlas b)
	{
		if (a == null || b == null) return false;
		return a == b || a.References(b) || b.References(a);
	}

Usage Example

Esempio n. 1
0
    /// <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);
            }
        }
    }
All Usage Examples Of UIAtlas::CheckIfRelated