1
NGUI 3 Support / UIPanel depth and raycast vs colliders
« on: January 29, 2014, 05:23:14 PM »
Hi,
I'm today switching my code from 2.x to 3.x, I have an empty object with UIStretch set to Both and a collider attached with size 1x1 and it should deny to raise events on underlying elements/interface (at least it worked in 2.x by using different Z in transform). Now if I understand the new guideline I have to maintain the same Z and use "Depth" of UIPanel to bring it back/forth, it works for rendering though it also raises events on underlying elements that reside in lower depth.
Here is an example:

The mouse was where you see "X", so it's intercepting the mouse-over event of the UIImageButton under it, here is the hierarchy:
UIRoot
- Camera
---Window (Z=0, Depth=1)
----GameObject with collider and UIStretch="Both"
----...other...
---Panel underlying (Z=0, Depth=0)
----Button
----Button
----...other...
Am I doing wrong or missing something? btw I also tried to use lower Z for "Window" to try if it worked like in 2.x but it didn't affect anything.
I'm today switching my code from 2.x to 3.x, I have an empty object with UIStretch set to Both and a collider attached with size 1x1 and it should deny to raise events on underlying elements/interface (at least it worked in 2.x by using different Z in transform). Now if I understand the new guideline I have to maintain the same Z and use "Depth" of UIPanel to bring it back/forth, it works for rendering though it also raises events on underlying elements that reside in lower depth.
Here is an example:

The mouse was where you see "X", so it's intercepting the mouse-over event of the UIImageButton under it, here is the hierarchy:
UIRoot
- Camera
---Window (Z=0, Depth=1)
----GameObject with collider and UIStretch="Both"
----...other...
---Panel underlying (Z=0, Depth=0)
----Button
----Button
----...other...
Am I doing wrong or missing something? btw I also tried to use lower Z for "Window" to try if it worked like in 2.x but it didn't affect anything.



