AddChild() public method

Add a child to the component. It will be at the frontmost position.
public AddChild ( GObject child ) : GObject
child GObject A child object
return GObject
Example #1
0
        public MyDragDropManager()
        {
            _agent = (GComponent)UIObjectFactory.NewObject("component");
            _agent.gameObjectName = "MyDragDropAgent";
            _agent.SetHome(GRoot.inst);
            _agent.touchable = false;//important
            _agent.draggable = true;
            //_agent.SetSize(100, 100);

            _agent.sortingOrder = int.MaxValue;
            _agent.onDragEnd.Add(__dragEnd);

            loader_a = (GLoader)UIObjectFactory.NewObject("loader");
            loader_a.SetPivot(0.5f, 0.5f, true);
            loader_a.align         = AlignType.Center;
            loader_a.verticalAlign = VertAlignType.Middle;

            loader_b = (GLoader)UIObjectFactory.NewObject("loader");
            loader_b.SetPivot(0.5f, 0.5f, true);
            loader_b.align         = AlignType.Center;
            loader_b.verticalAlign = VertAlignType.Middle;

            _agent.AddChild(loader_a);
            _agent.AddChild(loader_b);
        }
Example #2
0
 static public int AddChild(IntPtr l)
 {
     try {
         FairyGUI.GComponent self = (FairyGUI.GComponent)checkSelf(l);
         FairyGUI.GObject    a1;
         checkType(l, 2, out a1);
         var ret = self.AddChild(a1);
         pushValue(l, true);
         pushValue(l, ret);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static int AddChild(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         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    o    = obj.AddChild(arg0);
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }