Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: storm33229 on September 29, 2013, 07:27:49 PM
-
Now that I know NGUITools.AddChild adds a gameobject properly, I am curious how to migrate to a different parent.
-
gameObject.transform.parent = new parent object.transform
Is this what you were looking for? This changed the current object's parent to a new one.
-
gameObject.transform.parent = new parent object.transform
Is this what you were looking for? This changed the current object's parent to a new one.
Well, I use this one all the time... but I was curious if NGUI had a specific function for wrapping any special behavior it may want to do in addition to the re-parent.
-
After reparenting like that, make sure to broadcast "ParentHasChanged" to the affected game object.