Author Topic: Depth and colliders (NGUI 3_0_0)  (Read 2025 times)

dkozlovtsev

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
Depth and colliders (NGUI 3_0_0)
« on: October 15, 2013, 07:04:41 AM »
As i understand depth now works for different panels, but what about colliders?
But colliders depend on Z level for ordering.
So, is it true that now we should set both depth and Z level to get draw ordering and Input right?

JeremyBurgess

  • Guest
Re: Depth and colliders (NGUI 3_0_0)
« Reply #1 on: October 15, 2013, 08:09:30 AM »
Short answer - if your UICamera is set to have an eventType of UI, you don't need to worry about it.

Long answer:
NGUI 3 uses RaycastAll to collect input hits when working with an event type of UI, meaning it's able to see _all_ the colliders underneath a touch/click rather than just the closest one. It then sorts these by the depth of its panel * 1000 + its own depth. In practice this means that depths are all sorted by the same depth as they use to draw.

mishaps

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 65
    • View Profile
Re: Depth and colliders (NGUI 3_0_0)
« Reply #2 on: October 16, 2013, 01:51:56 AM »
Try latest version 3.0.2

dkozlovtsev

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 35
    • View Profile
Re: Depth and colliders (NGUI 3_0_0)
« Reply #3 on: October 16, 2013, 01:53:41 AM »
@JeremyBurgess
Thanks!