Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: VamppiV on October 13, 2014, 12:41:34 PM

Title: How to get and destroy a lot of UITexture from script?
Post by: VamppiV on October 13, 2014, 12:41:34 PM
I have script that make new UITextures when is OnEnable().

Now I'm looking how to get this textures to Destroy them on OnDisable(). It's really important to me to destroy OBJECTS.

My hierarchy:
--Panel (here's my script)
----ScrollView
-------Grid
----------Texture
----------Texture
----------...
----------(here I make new textures objects and this objects I want to completely destroy)
Title: Re: How to get and destroy a lot of UITexture from script?
Post by: ArenMook on October 14, 2014, 01:47:52 PM
UITexture tex = NGUITools.AddWidget<UITexture>(parentObject);
NGUITools.Destroy(tex.gameObject);