Author Topic: How to get and destroy a lot of UITexture from script?  (Read 1261 times)

VamppiV

  • Newbie
  • *
  • Thank You
  • -Given: 5
  • -Receive: 1
  • Posts: 15
    • View Profile
How to get and destroy a lot of UITexture from script?
« 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)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How to get and destroy a lot of UITexture from script?
« Reply #1 on: October 14, 2014, 01:47:52 PM »
UITexture tex = NGUITools.AddWidget<UITexture>(parentObject);
NGUITools.Destroy(tex.gameObject);