FairyGUI.GComponent.SwapChildren C# (CSharp) Method

SwapChildren() public method

Swaps the indexes of two children.
public SwapChildren ( GObject child1, GObject child2 ) : void
child1 GObject A child object
child2 GObject A child object
return void
        public void SwapChildren(GObject child1, GObject child2)
        {
            int index1 = _children.IndexOf(child1);
            int index2 = _children.IndexOf(child2);
            if (index1 == -1 || index2 == -1)
                throw new Exception("Not a child of this container");
            SwapChildrenAt(index1, index2);
        }

Usage Example

 static int SwapChildren(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         FairyGUI.GComponent obj  = (FairyGUI.GComponent)ToLua.CheckObject(L, 1, typeof(FairyGUI.GComponent));
         FairyGUI.GObject    arg0 = (FairyGUI.GObject)ToLua.CheckObject(L, 2, typeof(FairyGUI.GObject));
         FairyGUI.GObject    arg1 = (FairyGUI.GObject)ToLua.CheckObject(L, 3, typeof(FairyGUI.GObject));
         obj.SwapChildren(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
All Usage Examples Of FairyGUI.GComponent::SwapChildren