Author Topic: NGUI Chat example question - When disabling and re-enabling it breaks  (Read 3175 times)

Mhason

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 3
    • View Profile
Hi,

Maybe you can help me out here. I am trying to use the Chat text list but when I disable the parent object and the children and then re-enable it the functionality breaks. I was able to reproduce this by using the standard example as well, it looks like the text label is not being added when object is re-enabled.

I should add - I am re-enabling by using the button animation script that allows you to enable the object when it is called and then disable it again afterwards.  Simply disabling and re-enabling the object in the editor does not do this error and works fine. If I do not disable the text list component it seems to work ok though.

Any advice?   

Thank you for the help and for a great product!

Mhason
« Last Edit: September 02, 2012, 01:50:14 PM by Mhason »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI Chat example question - When disabling and re-enabling it breaks
« Reply #1 on: September 02, 2012, 04:08:58 PM »
Are you using SetActiveRecursively? It re-activates children before parents, which is quite broken.

Use NGUITools.SetActive instead.