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
Ejemplo 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);
            }
        }
    }
Ejemplo n.º 2
0
    /// <summary>
    /// Convenience function -- mark all widgets using the sprite as changed.
    /// </summary>

    void MarkSpriteAsDirty()
    {
        UISpriteData sprite = (mAtlas != null) ? mAtlas.GetSprite(NGUISettings.selectedSprite) : null;

        if (sprite == null)
        {
            return;
        }

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

        foreach (UISprite sp in sprites)
        {
            if (UIAtlas.CheckIfRelated(sp.atlas, mAtlas) && sp.spriteName == sprite.name)
            {
                UIAtlas atl = sp.atlas;
                sp.atlas = null;
                sp.atlas = atl;
                EditorUtility.SetDirty(sp);
            }
        }

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

        foreach (UILabel lbl in labels)
        {
            if (lbl.bitmapFont != null && UIAtlas.CheckIfRelated(lbl.bitmapFont.atlas, mAtlas) && lbl.bitmapFont.UsesSprite(sprite.name))
            {
                UIFont font = lbl.bitmapFont;
                lbl.bitmapFont = null;
                lbl.bitmapFont = font;
                EditorUtility.SetDirty(lbl);
            }
        }
    }
Ejemplo n.º 3
0
    static int CheckIfRelated(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 2);
        UIAtlas arg0 = (UIAtlas)LuaScriptMgr.GetUnityObject(L, 1, typeof(UIAtlas));
        UIAtlas arg1 = (UIAtlas)LuaScriptMgr.GetUnityObject(L, 2, typeof(UIAtlas));
        bool    o    = UIAtlas.CheckIfRelated(arg0, arg1);

        LuaScriptMgr.Push(L, o);
        return(1);
    }
Ejemplo n.º 4
0
    private static int CheckIfRelated(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 2);
        UIAtlas a  = (UIAtlas)LuaScriptMgr.GetUnityObject(L, 1, typeof(UIAtlas));
        UIAtlas b  = (UIAtlas)LuaScriptMgr.GetUnityObject(L, 2, typeof(UIAtlas));
        bool    b2 = UIAtlas.CheckIfRelated(a, b);

        LuaScriptMgr.Push(L, b2);
        return(1);
    }
Ejemplo n.º 5
0
    public void MarkAsChanged()
    {
        if (this.mReplacement != null)
        {
            this.mReplacement.MarkAsChanged();
        }
        UISprite[] array = NGUITools.FindActive <UISprite>();
        int        i     = 0;
        int        num   = array.Length;

        while (i < num)
        {
            UISprite uISprite = array[i];
            if (UIAtlas.CheckIfRelated(this, uISprite.atlas))
            {
                UIAtlas atlas = uISprite.atlas;
                uISprite.atlas = null;
                uISprite.atlas = atlas;
            }
            i++;
        }
        UIFont[] array2 = Resources.FindObjectsOfTypeAll(typeof(UIFont)) as UIFont[];
        int      j      = 0;
        int      num2   = array2.Length;

        while (j < num2)
        {
            UIFont uIFont = array2[j];
            if (UIAtlas.CheckIfRelated(this, uIFont.atlas))
            {
                UIAtlas atlas2 = uIFont.atlas;
                uIFont.atlas = null;
                uIFont.atlas = atlas2;
            }
            j++;
        }
        UILabel[] array3 = NGUITools.FindActive <UILabel>();
        int       k      = 0;
        int       num3   = array3.Length;

        while (k < num3)
        {
            UILabel uILabel = array3[k];
            if (uILabel.bitmapFont != null && UIAtlas.CheckIfRelated(this, uILabel.bitmapFont.atlas))
            {
                UIFont bitmapFont = uILabel.bitmapFont;
                uILabel.bitmapFont = null;
                uILabel.bitmapFont = bitmapFont;
            }
            k++;
        }
    }
Ejemplo n.º 6
0
    public void MarkAsChanged()
    {
        if (this.mReplacement != (UnityEngine.Object)null)
        {
            this.mReplacement.MarkAsChanged();
        }
        UISprite[] array = NGUITools.FindActive <UISprite>();
        Int32      i     = 0;
        Int32      num   = (Int32)array.Length;

        while (i < num)
        {
            UISprite uisprite = array[i];
            if (UIAtlas.CheckIfRelated(this, uisprite.atlas))
            {
                UIAtlas atlas = uisprite.atlas;
                uisprite.atlas = (UIAtlas)null;
                uisprite.atlas = atlas;
            }
            i++;
        }
        UIFont[] array2 = Resources.FindObjectsOfTypeAll(typeof(UIFont)) as UIFont[];
        Int32    j      = 0;
        Int32    num2   = (Int32)array2.Length;

        while (j < num2)
        {
            UIFont uifont = array2[j];
            if (UIAtlas.CheckIfRelated(this, uifont.atlas))
            {
                UIAtlas atlas2 = uifont.atlas;
                uifont.atlas = (UIAtlas)null;
                uifont.atlas = atlas2;
            }
            j++;
        }
        UILabel[] array3 = NGUITools.FindActive <UILabel>();
        Int32     k      = 0;
        Int32     num3   = (Int32)array3.Length;

        while (k < num3)
        {
            UILabel uilabel = array3[k];
            if (uilabel.bitmapFont != (UnityEngine.Object)null && UIAtlas.CheckIfRelated(this, uilabel.bitmapFont.atlas))
            {
                UIFont bitmapFont = uilabel.bitmapFont;
                uilabel.bitmapFont = (UIFont)null;
                uilabel.bitmapFont = bitmapFont;
            }
            k++;
        }
    }
Ejemplo n.º 7
0
    public void MarkAsDirty()
    {
        UISprite[] uISpriteArray = NGUITools.FindActive <UISprite>();
        int        num           = 0;
        int        length        = (int)uISpriteArray.Length;

        while (num < length)
        {
            UISprite uISprite = uISpriteArray[num];
            if (UIAtlas.CheckIfRelated(this, uISprite.atlas))
            {
                UIAtlas uIAtla = uISprite.atlas;
                uISprite.atlas = null;
                uISprite.atlas = uIAtla;
            }
            num++;
        }
        UIFont[] uIFontArray = Resources.FindObjectsOfTypeAll(typeof(UIFont)) as UIFont[];
        int      num1        = 0;
        int      length1     = (int)uIFontArray.Length;

        while (num1 < length1)
        {
            UIFont uIFont = uIFontArray[num1];
            if (UIAtlas.CheckIfRelated(this, uIFont.atlas))
            {
                UIAtlas uIAtla1 = uIFont.atlas;
                uIFont.atlas = null;
                uIFont.atlas = uIAtla1;
            }
            num1++;
        }
        UILabel[] uILabelArray = NGUITools.FindActive <UILabel>();
        int       num2         = 0;
        int       length2      = (int)uILabelArray.Length;

        while (num2 < length2)
        {
            UILabel uILabel = uILabelArray[num2];
            if (uILabel.font != null && UIAtlas.CheckIfRelated(this, uILabel.font.atlas))
            {
                UIFont uIFont1 = uILabel.font;
                uILabel.font = null;
                uILabel.font = uIFont1;
            }
            num2++;
        }
    }
Ejemplo n.º 8
0
 static int CheckIfRelated(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         UIAtlas arg0 = (UIAtlas)ToLua.CheckObject <UIAtlas>(L, 1);
         UIAtlas arg1 = (UIAtlas)ToLua.CheckObject <UIAtlas>(L, 2);
         bool    o    = UIAtlas.CheckIfRelated(arg0, arg1);
         LuaDLL.lua_pushboolean(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Ejemplo n.º 9
0
 static public int CheckIfRelated_s(IntPtr l)
 {
     try {
         UIAtlas a1;
         checkType(l, 1, out a1);
         UIAtlas a2;
         checkType(l, 2, out a2);
         var ret = UIAtlas.CheckIfRelated(a1, a2);
         pushValue(l, true);
         pushValue(l, ret);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Ejemplo n.º 10
0
    /// <summary>
    /// Convenience function -- mark all widgets using the sprite as changed.
    /// </summary>

    void MarkSpriteAsDirty()
    {
        UISpriteData sprite = (mAtlas != null) ? mAtlas.GetSprite(NGUISettings.selectedSprite) : null;

        if (sprite == null)
        {
            return;
        }

        UISprite[] sprites = NGUITools.FindActive <UISprite>();
        {
            var __array1       = sprites;
            var __arrayLength1 = __array1.Length;
            for (int __i1 = 0; __i1 < __arrayLength1; ++__i1)
            {
                var sp = (UISprite)__array1[__i1];
                {
                    if (UIAtlas.CheckIfRelated(sp.atlas, mAtlas) && sp.spriteName == sprite.name)
                    {
                        UIAtlas atl = sp.atlas;
                        sp.atlas = null;
                        sp.atlas = atl;
                        EditorUtility.SetDirty(sp);
                    }
                }
            }
        }
        UILabel[] labels = NGUITools.FindActive <UILabel>();
        {
            var __array2       = labels;
            var __arrayLength2 = __array2.Length;
            for (int __i2 = 0; __i2 < __arrayLength2; ++__i2)
            {
                var lbl = (UILabel)__array2[__i2];
                {
                    if (lbl.bitmapFont != null && UIAtlas.CheckIfRelated(lbl.bitmapFont.atlas, mAtlas) && lbl.bitmapFont.UsesSprite(sprite.name))
                    {
                        UIFont font = lbl.bitmapFont;
                        lbl.bitmapFont = null;
                        lbl.bitmapFont = font;
                        EditorUtility.SetDirty(lbl);
                    }
                }
            }
        }
    }
Ejemplo n.º 11
0
    public static int CheckIfRelated_s(IntPtr l)
    {
        int result;

        try
        {
            UIAtlas a;
            LuaObject.checkType <UIAtlas>(l, 1, out a);
            UIAtlas b;
            LuaObject.checkType <UIAtlas>(l, 2, out b);
            bool b2 = UIAtlas.CheckIfRelated(a, b);
            LuaObject.pushValue(l, true);
            LuaObject.pushValue(l, b2);
            result = 2;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }