Author Topic: Hide Contents of panels (not disable it)  (Read 1759 times)

Darkmax

  • Jr. Member
  • **
  • Thank You
  • -Given: 2
  • -Receive: 1
  • Posts: 93
    • View Profile
Hide Contents of panels (not disable it)
« on: December 14, 2012, 07:28:06 PM »
Hi want to hide all the contents of a panel, i tried with NGUITools.SetActive(), but this disable the objects and when i tried to find the objects with GameObject.Find() returns null, so what i want is just to hide them, but stay active on hierachy.


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Hide Contents of panels (not disable it)
« Reply #1 on: December 14, 2012, 08:02:28 PM »
What are you trying to find? GameObject.Find can't find objects that you've disabled (such as via SetActive). I suggest you keep a reference to whatever it is you're trying to find (it's a lot faster this way too).

Another option is to use the NGUITools.SetActiveChildren instead. It will keep your root object enabled, thus allowing you to find it.

Darkmax

  • Jr. Member
  • **
  • Thank You
  • -Given: 2
  • -Receive: 1
  • Posts: 93
    • View Profile
Re: Hide Contents of panels (not disable it)
« Reply #2 on: December 15, 2012, 12:00:12 AM »
ok thx, i will try to keep the reference