Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: noob22 on July 02, 2012, 08:20:49 PM

Title: I cloned sprite ,but it don't have same transform with it's model gameobject.Why
Post by: noob22 on July 02, 2012, 08:20:49 PM
I use "NGUITools.AddChild(Panel, Button);"
Panel is parent and Button is model gameobject.
Why a clone have a different transform with it's model gameobject?
How to clone a gameobject with the same transform by it's model gameobject?
And Suggestions?
Title: Re: I cloned sprite ,but it don't have same transform with it's model gameobject.Why
Post by: ArenMook on July 02, 2012, 08:59:52 PM
NGUITools.AddChild clears the transform to 0 0 0.
Title: Re: I cloned sprite ,but it don't have same transform with it's model gameobject.Why
Post by: noob22 on July 02, 2012, 09:06:46 PM
NGUITools.AddChild clears the transform to 0 0 0.
I have got it!
GameObject g = NGUITools.AddChild(Panel, Button);
UISprite ui = g.GetComponent<UISprite>();
ui.MakePixelPerfect();
Thanks for your reply!