Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: singh029 on February 22, 2016, 02:22:24 AM

Title: prevent click through to bottom ngui widget.
Post by: singh029 on February 22, 2016, 02:22:24 AM
I was wondering if theres a way to get the layer name of the widget that is clicked.

Im using playmaker to call a void method on click of outside area (not panel) to disable a panel. But everytime i click the panel it keeps closing. The click keeps falling through to the widget below it, so it closes. How do i prevent that?

Im setting UI Camera depth on layers but that doesnt seem to help.

Please save mee!
Title: Re: prevent click through to bottom ngui widget.
Post by: dogfacedesign on February 22, 2016, 04:34:40 AM
These links might help:

http://answers.unity3d.com/questions/585108/how-do-you-access-sorting-layers-via-scripting.html

http://forum.unity3d.com/threads/list-of-sorting-layers.210683/

Cheers.
Title: Re: prevent click through to bottom ngui widget.
Post by: singh029 on February 22, 2016, 07:27:47 PM
These links might help:

http://answers.unity3d.com/questions/585108/how-do-you-access-sorting-layers-via-scripting.html

http://forum.unity3d.com/threads/list-of-sorting-layers.210683/

Cheers.

thank you for your help but i just solved it by putting a box collider on the panel so it absorbs the clicks. :)
I apologize, I didn't ask the correct questions.
Title: Re: prevent click through to bottom ngui widget.
Post by: zenmaster on February 22, 2016, 09:52:57 PM
For Popup dialogs/GUIs that are widgets, I have the same solution of adding a "ClickBlocker" widget.
Anchors to the background widget and stretches out to size of dialog/GUI.

You will run into a problem when you disable buttons.
It will disable the collider and click events will go through disabled buttons to what is underneath.
Yes your users are going to click disabled buttons.
For me it was a map that accepted click.

I argued with him over it but got nowhere.