Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Fordeka on August 07, 2012, 11:33:57 AM

Title: Making OnPress fire false when leaving the collider bounds
Post by: Fordeka on August 07, 2012, 11:33:57 AM
Hi Aren,

I need to have buttons that release if you touch and drag outside the bounds of the button's collider, can you suggest a good way to achieve this behavior without seriously tangling up NGUI?
Title: Re: Making OnPress fire false when leaving the collider bounds
Post by: ArenMook on August 07, 2012, 12:36:21 PM
You can cancel the effect's visual component by sending SendMessage("OnPress", false) to the highlighted button. You can check to see what's under the mouse in your update function by checking UICamera.lastHit.collider.