Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: hmnyari on June 12, 2013, 03:16:10 AM

Title: How can I detect clicking(touch) event??
Post by: hmnyari on June 12, 2013, 03:16:10 AM
I want to detect touch event

UiButtonMessage has [OnMouseOver] event but this event not work at mobile

and[ OnPress ] call method only 1 time.

I want to call method every frame when Pressing button. not one time.

How can I do? 
Title: Re: How can I detect clicking(touch) event??
Post by: ArenMook on June 12, 2013, 04:24:39 AM
OnMouseOver is a Unity's built-in event for colliders and should not be used.

NGUI has OnHover (bool isOver).

Furthermore, there is no "hover" on mobiles. How would you detect your finger hovering over a button? You can't.

Instead in OnPress(true) set a boolean flag declared within your class. Check this flag in Update() and call your logic repeatedly.
Title: Re: How can I detect clicking(touch) event??
Post by: hmnyari on June 13, 2013, 02:14:32 AM
Thank you ArenMook  :)