Exemple #1
0
 public static void ParentPanelChanged(GameObject go, UIRect parent, UIPanel panel)
 {
     if (panel != null)
     {
         NGUITools.tmpRects.Clear();
         go.GetComponentsInChildren <UIRect>(NGUITools.tmpRects);
         if (NGUITools.tmpRects.Count > 0)
         {
             UIRect uIRect = NGUITools.tmpRects[0];
             if (uIRect.gameObject == go)
             {
                 uIRect.ChangeParent(parent);
                 int i     = 0;
                 int count = NGUITools.tmpRects.Count;
                 while (i < count)
                 {
                     NGUITools.tmpRects[i].SetPanel(panel);
                     i++;
                 }
             }
             else
             {
                 uIRect.ChangeParent();
                 int j      = 0;
                 int count2 = NGUITools.tmpRects.Count;
                 while (j < count2)
                 {
                     NGUITools.tmpRects[j].SetPanel(panel);
                     j++;
                 }
             }
         }
         NGUITools.tmpRects.Clear();
     }
 }
Exemple #2
0
 public static void MarkParentAsChanged(GameObject go)
 {
     NGUITools.tmpRects.Clear();
     go.GetComponentsInChildren <UIRect>(NGUITools.tmpRects);
     if (NGUITools.tmpRects.Count > 0)
     {
         UIRect uIRect = NGUITools.tmpRects[0];
         if (uIRect.gameObject == go)
         {
             uIRect.ChangeParent();
             UIPanel panel = UIPanel.Find(uIRect.cachedTransform, true, uIRect.cachedGameObject.layer);
             int     i     = 0;
             int     count = NGUITools.tmpRects.Count;
             while (i < count)
             {
                 NGUITools.tmpRects[i].SetPanel(panel);
                 i++;
             }
         }
         else
         {
             int j      = 0;
             int count2 = NGUITools.tmpRects.Count;
             while (j < count2)
             {
                 NGUITools.tmpRects[j].ParentHasChanged();
                 j++;
             }
         }
     }
     NGUITools.tmpRects.Clear();
 }
    private static int ChangeParent(IntPtr L)
    {
        int num = LuaDLL.lua_gettop(L);

        if (num == 1)
        {
            UIRect uIRect = (UIRect)LuaScriptMgr.GetUnityObjectSelf(L, 1, "UIRect");
            uIRect.ChangeParent();
            return(0);
        }
        if (num == 2)
        {
            UIRect uIRect2 = (UIRect)LuaScriptMgr.GetUnityObjectSelf(L, 1, "UIRect");
            UIRect pt      = (UIRect)LuaScriptMgr.GetUnityObject(L, 2, typeof(UIRect));
            uIRect2.ChangeParent(pt);
            return(0);
        }
        LuaDLL.luaL_error(L, "invalid arguments to method: UIRect.ChangeParent");
        return(0);
    }
    public static int ChangeParent(IntPtr l)
    {
        int result;

        try
        {
            int num = LuaDLL.pua_gettop(l);
            if (num == 1)
            {
                UIRect uIRect = (UIRect)LuaObject.checkSelf(l);
                uIRect.ChangeParent();
                LuaObject.pushValue(l, true);
                result = 1;
            }
            else if (num == 2)
            {
                UIRect uIRect2 = (UIRect)LuaObject.checkSelf(l);
                UIRect pt;
                LuaObject.checkType <UIRect>(l, 2, out pt);
                uIRect2.ChangeParent(pt);
                LuaObject.pushValue(l, true);
                result = 1;
            }
            else
            {
                LuaObject.pushValue(l, false);
                LuaDLL.pua_pushstring(l, "No matched override function to call");
                result = 2;
            }
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
Exemple #5
0
    static int ChangeParent(IntPtr L)
    {
        int count = LuaDLL.lua_gettop(L);

        if (count == 1)
        {
            UIRect obj = (UIRect)LuaScriptMgr.GetUnityObjectSelf(L, 1, "UIRect");
            obj.ChangeParent();
            return(0);
        }
        else if (count == 2)
        {
            UIRect obj  = (UIRect)LuaScriptMgr.GetUnityObjectSelf(L, 1, "UIRect");
            UIRect arg0 = (UIRect)LuaScriptMgr.GetUnityObject(L, 2, typeof(UIRect));
            obj.ChangeParent(arg0);
            return(0);
        }
        else
        {
            LuaDLL.luaL_error(L, "invalid arguments to method: UIRect.ChangeParent");
        }

        return(0);
    }