Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - troutmonkey

Pages: [1]
1
NGUI 3 Support / Re: Never use Instantiate(). Use NGUITools.AddChild.
« on: October 01, 2014, 10:00:55 PM »
EDIT: Nope, I'm an idiot.  Fixed it.

2
NGUI 3 Support / Re: Never use Instantiate(). Use NGUITools.AddChild.
« on: October 01, 2014, 09:22:41 PM »
After some fiddling about I managed to get AddChild working, but here's the problem I ran into.

The prefab has to be a GameObject. Have the prefab be a Transform or custom MonoBehaviour script will instead create an empty gameObject. It would also be cool if there was a method that set the position as well - AddChild(GameObject parent, GameObject prefab, Vector3 position). Would save an extra line of code.

Pages: [1]