Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: fanling3 on May 11, 2014, 01:36:38 AM
-
Since the UICamera and MainCamera are seperated in NGUI, so if I have some OnMouseDown events for my gameObjects in the scene, they will be triggered even I tried to click UIButtons, any quick way to fix this?
I have tried to add invisible colliders under MainCamera to cover the UIButtons area but it's not effective when the aspect ratio is changed.
Thanks.
-
Don't use OnMouse events. They are not NGUI events.
Attach UICamera to your main camera as well.
-
Don't use OnMouse events. They are not NGUI events.
Attach UICamera to your main camera as well.
How can I not to use OnMouse events if I want to do something like: click on the terrain and command a character to move?
The current issue is that when I click on the UIButton the character will move as well.
-
Like I said... don't use OnMouse. OnMouse is a Unity event. NGUI's equivalents are sent by UICamera. As long as you have a UICamera attached to the camera that sees the objects with colliders, they will be receiving NGUI's events like OnHover, OnPress, OnClick, etc.
As an added benefit, clicking on the button won't trigger an NGUI event on whatever is behind that button.