Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: zippo227 on February 20, 2014, 02:04:04 AM

Title: How to block OnMouseOver with UIPanel
Post by: zippo227 on February 20, 2014, 02:04:04 AM
Hi I have some clickable objects in my game that are not using NGUI at all. When I have an NGUI panel with a 2d box collider that covers that object, the OnMouseOver events on that object are still called. Is there a way to block that event, or do I need to have a reference to the GUI camera and poll it somehow to see if I should not respond to this event. Thank you!
Title: Re: How to block OnMouseOver with UIPanel
Post by: indrkl on February 20, 2014, 05:44:53 AM
I would also be really interested in knowing how to do that. The reason is I'm using polygon colliders in the game world (Hexagon map for a turn based strategy game), and I don't want the clicks on the map to do anything while I am mouse overing any part of my UI.
Title: Re: How to block OnMouseOver with UIPanel
Post by: ArenMook on February 20, 2014, 09:26:54 AM
OnMouseOver is a Unity event, not an NGUI event. You can't block it.

OnHover(bool isOver) is the NGUI equivalent.

Also you can't block anything with a UIPanel because UIPanel is just what draws widgets. You can only block things with other widgets. ALT+SHIFT+W creates an invisible widget. ALT+SHIFT+C gives it a collider. This widget will now block hover events.