Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GUI of Unity 4.6 - Detecting On Click() Down

I'm using the GUI of Unity 4.6 beta and I need to detect the "On Click() Down" similar to "Mouse Down". The default is mouse up.

"

Thanks!

like image 485
benLIVE Avatar asked Dec 15 '22 18:12

benLIVE


1 Answers

  1. First remove your OnClick() line.
  2. Now, at the bottom of the inspector, click Add Component.
  3. Choose Event -> Event Trigger.
  4. Now Add New Event Type to choose a custom event.
  5. The event you want is called Pointer Down.

Now just add your lines like you did for OnClick().

A section of a video explaining the event handler can be found here.

like image 100
Hicsy Avatar answered Dec 30 '22 13:12

Hicsy