1
NGUI 3 Support / Collider blocking other UIs
« on: April 16, 2014, 01:05:30 PM »
Hi, I have searched for 2 days and have not found the answer so here it goes.
I'm using NGUI 2.5.1 and it's hard to upgrade to the latest version without breaking my game or tonnes of regression I don't have time for so I'm stuck with this version.
I have many UIs in my game, each has their UIRoots and a Camera+UICamera. All of them are culled to a layer called "ui" And Event Receiver Mask also set to "ui"
Everything works great! I wrote a script that rotates my camera using unity's Input.GetTouch() but that is very badly written and does not work that well so I replaced it entirely with NGUI's OnDrag, here I will explain.
I have 1 special UI that needs to be independent from all these UIs, for the purpose of the camera rotate function. What this UI is, is really not a UI but a box collider that covers the whole screen and has a script that receives OnDrag even from the UICamera.
This works really well, however, many times when I instanciate one of my UIs, which has it's own camera, the large collider of the camera rotating "UI" blocks off everything and thus none of my UIs will function anymore.
I have tried using a dedicated camera that is in a different layer than "ui" which was exclusively used for NGUI, so I figured maybe I need a new layer that is dedicated for just the camera rotate OnDrag stuff.. but that still does't help, the collider still blocks off everything.
I tried moving the collider very far from the camera, but that does nothing. I tried figuring if I can set a depth by making the collider have a UILabel component so I can set the dept(what a hack I tried lol) but still that does nothing.
Please let me know how I can get around this. If I am unclear in my description I will provide better detail. Hope to hear from you soon.
Thanks!
I'm using NGUI 2.5.1 and it's hard to upgrade to the latest version without breaking my game or tonnes of regression I don't have time for so I'm stuck with this version.
I have many UIs in my game, each has their UIRoots and a Camera+UICamera. All of them are culled to a layer called "ui" And Event Receiver Mask also set to "ui"
Everything works great! I wrote a script that rotates my camera using unity's Input.GetTouch() but that is very badly written and does not work that well so I replaced it entirely with NGUI's OnDrag, here I will explain.
I have 1 special UI that needs to be independent from all these UIs, for the purpose of the camera rotate function. What this UI is, is really not a UI but a box collider that covers the whole screen and has a script that receives OnDrag even from the UICamera.
This works really well, however, many times when I instanciate one of my UIs, which has it's own camera, the large collider of the camera rotating "UI" blocks off everything and thus none of my UIs will function anymore.
I have tried using a dedicated camera that is in a different layer than "ui" which was exclusively used for NGUI, so I figured maybe I need a new layer that is dedicated for just the camera rotate OnDrag stuff.. but that still does't help, the collider still blocks off everything.
I tried moving the collider very far from the camera, but that does nothing. I tried figuring if I can set a depth by making the collider have a UILabel component so I can set the dept(what a hack I tried lol) but still that does nothing.
Please let me know how I can get around this. If I am unclear in my description I will provide better detail. Hope to hear from you soon.
Thanks!