Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Tomleung on May 27, 2014, 04:59:24 AM

Title: How to click on NGUI UI but not trigger the events of the scene?
Post by: Tomleung on May 27, 2014, 04:59:24 AM
How to click on NGUI UI but not trigger the events of the scene?

It is because I have some touch events on the gameobjects in the scene, if I click on NGUI, if would trigger the scene events too.

How to avoid it?

Thx.
Title: Re: How to click on NGUI UI but not trigger the events of the scene?
Post by: Darkmax on May 27, 2014, 12:45:18 PM
If you want that ngui doesn't catch the events you can disable the component UICamera, this will not trigger any event of ngui
Title: Re: How to click on NGUI UI but not trigger the events of the scene?
Post by: Tomleung on May 28, 2014, 03:22:55 AM
If you want that ngui doesn't catch the events you can disable the component UICamera, this will not trigger any event of ngui

No, I mean how to avoid trigger the other events but still trigger the UI ?

If I have a cube in the scene, and if I click it, it would destroy.
However, now if the cube and the UI is overlapping and if I click on the UI, it would also destroy the cube too so I need to avoid it.
Title: Re: How to click on NGUI UI but not trigger the events of the scene?
Post by: ArenMook on May 28, 2014, 06:36:24 AM
You need to use NGUI events all the way, not check your own Input.Get keys yourself. Check the documentation page for the UICamera. You will need a UICamera script on your main camera as well.