Author Topic: 3.0.8 Depth & NGUITools.SetActive  (Read 2751 times)

NaxIonz

  • Jr. Member
  • **
  • Thank You
  • -Given: 3
  • -Receive: 0
  • Posts: 70
    • View Profile
3.0.8 Depth & NGUITools.SetActive
« on: December 17, 2013, 12:36:55 PM »
It appears that the depth of widgets gets a bit confused with the latest 3.0.8 and toggling GameObjects active/inactive.

I'm seeing it in one screen where I set one hierarchy inactive then active, and the depth sorting is all weird. The actual depth values aren't changing, of course, but they don't render properly, things are all out of order.

I even noticed it in the UIPopupList, that the highlight is appearing in front of the text even though it's depth is a good 10 less than the text.

Is there a change I have overlooked?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: 3.0.8 Depth & NGUITools.SetActive
« Reply #1 on: December 17, 2013, 12:41:04 PM »
3.0.8 as in the latest beta from the Pro repository? I did a quick test, and everything seems correct from what I can tell. I'd need a repro case.

NaxIonz

  • Jr. Member
  • **
  • Thank You
  • -Given: 3
  • -Receive: 0
  • Posts: 70
    • View Profile
Re: 3.0.8 Depth & NGUITools.SetActive
« Reply #2 on: December 17, 2013, 01:13:45 PM »
3.0.8 as in the latest beta from the Pro repository? I did a quick test, and everything seems correct from what I can tell. I'd need a repro case.

Everything looks fine in edit mode, but could you run the game, and have a button toggle to call:
NGUITools.SetActive(someObject, false/true)
NGUITools.SetActive(someOtherObject, true/false)
When I do that, everything is in the wrong order after that.

But that really doesn't explain the other thing, the UIPopupList :-\
« Last Edit: December 17, 2013, 01:31:53 PM by NaxIonz »

NaxIonz

  • Jr. Member
  • **
  • Thank You
  • -Given: 3
  • -Receive: 0
  • Posts: 70
    • View Profile
Re: 3.0.8 Depth & NGUITools.SetActive
« Reply #3 on: December 17, 2013, 01:38:11 PM »
FWIW, if I add this after the two calls to SetActive, it works :-\


m_panel.enabled = false;
m_panel.enabled = true;

oh, and m_panel.Invalidate(false) does *not* work, just doing that enable toggling

EDIT:
m_panel.Refresh() works too.
Huh, never needed to do that. I guess that was from the perf changes?

EDIT 2:
Going back to the UIPopupList occurrence,
Calling mPanel.Refresh() inside UIPopupList.OnClick doesn't seem to fix that. Manually togging the panel disabled/enabled in the editor does fix the UIPopupList (until it's opened again).
« Last Edit: December 17, 2013, 02:06:32 PM by NaxIonz »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: 3.0.8 Depth & NGUITools.SetActive
« Reply #4 on: December 18, 2013, 12:46:05 PM »
Let's focus on the popup list first. If you can give repro steps for me to follow, I'd appreciate it.