Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Moradom on January 22, 2014, 08:28:25 PM

Title: Detecting when drag moves off a collider
Post by: Moradom on January 22, 2014, 08:28:25 PM
Hello all,

I am looking for a way to detect when when a touch drags off a collider. For example a touch is detected on a collider with OnPress() then I would like to know when that touch drags off that collider.

After reviewing the UICamera's notification events I didn't see a specific notification for that.

Thanks
Title: Re: Detecting when drag moves off a collider
Post by: Moradom on January 22, 2014, 09:07:27 PM
Wanted to share a quick update

I am sure there might be a better way, but I was able to get this behavior by checking the tag in the UICamera.hoveredObject in the OnDrag event handler. Once I detected the tag changed from the touched gameObject I knew the touch was dragged off the collider.
Title: Re: Detecting when drag moves off a collider
Post by: ArenMook on January 23, 2014, 05:57:21 AM
OnDragOut tells you when you've left a collider. OnDragOver tells you when you've moved over a collider.