On Android, could you use the new UI and still get touch down and touch release events?

I have been learning the new Unity UI and want to have a UIButton connected to a onButtonPress as well as an onButtonRelease script. All I see is an OnClick. Previously, I would iterate through input.touches and check the touch.phase and divide up my screen space into a lot of different regions. This was a pain and I was hoping to just leverage the new UI system for something like an accelerate button that gives gas as long as its pressed. So far my internet searches aren’t fruitful so any help is appreciated.

Unity UI should allow you to do it easily.

  1. Add a button (UI > Button)
  2. Add the handlers for pointer down, up

UI Events described here: http://unity3d.com/learn/tutorials/modules/beginner/ui/ui-events-and-event-triggers

2 Likes