Author Topic: UIGrid AddChild function not work in version 3.6.5  (Read 3409 times)

sgstester

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
UIGrid AddChild function not work in version 3.6.5
« on: June 22, 2014, 02:35:42 AM »
Hi,

Today i upgrade my NGUI to 3.6.5, before that, everything work well in my project, i'm using function addchild(transform, index), after upgraded, it doesn't work anymore, i tried to debug using getchild function after addchild to grid and see that it return nothing, so that mean u changed somethings in uigrid and now it have problem, plz check it and update soon

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIGrid AddChild function not work in version 3.6.5
« Reply #1 on: June 22, 2014, 10:58:48 PM »
Don't use this function. You can't insert objects into the grid properly because there is no way to insert an object in the transform's list of children that the UIGrid relies on. This feature is going to be possible in Unity 4.6 (that's when Unity is adding support for it).

To add a child to the grid, simply set its transform.
  1. yourObject.transform.parent = grid.transform;