Author Topic: Problems with multiple UIPanels at same depth  (Read 1965 times)

dmonk

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Problems with multiple UIPanels at same depth
« on: July 21, 2014, 10:57:20 PM »
I am in the process of upgrading from NGUI 3.0.7 f3 to 3.6.8, and after integrating everything down and fixing the compile issues and what not, I have one new bug that I cant' figure out.

I have a scene that has two UIPanels - the UIRoot Panel, at a depth of 0, and a nested ScrollView Panel, which is also at a depth of zero.  However, in this scene, regardless of the depth value of the widgits I place within the scrollview, they always are drawn behind the root panel.
 
If I bump the depth of the nested scroll view, then the widgits in the scrollview panel do in fact draw on top.  But I need the panels to both remain at the same depth, because I have other elements in the root panel, with greater depths, that I want to be able to draw on top of the scrollview (tooltips, error dialogs, etc).  So I can't just bump the ScrollView panel depth to 1 to force it to be on top.

Other data points:
I have another scene with this exact same setup, and the panels work correctly. I have scoured every parameter of the panels and widgits between the two scenes, and can find no differences.
 
If I create a new empty game object in this scene, assign it UIRoot, UIPanel, and RigidBody components, and drag the entire hierarchy from the old UIRoot object into the new UIRoot object, the ScrollView widgets suddenly begin to work correctly.  Until I save the scene, exit unity, and reload the scene.
 
This setup worked correctly prior to the upgrade. 
 
It's almost as if it were treating depth as a float, and this were some sort of odd floating point error, but I can clearly see depth is an int on UIPanel. But regardless, something is forcing all of the widgits in my scrollview panel to draw behind the root panel, regardless of what I set their depth to, even though both panels are set to a depth of 0.
 
Thoughts?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Problems with multiple UIPanels at same depth
« Reply #1 on: July 22, 2014, 08:43:11 PM »
Widgets can't be shared between panels anymore. Each panel is completely separate, and its contents will be either in front or behind other panels. Your scroll view should be on top (higher depth). If you want something to go on top of that, create a 3rd panel (even higher depth).