I've been using OnPress() events for button IO. I now want a long-press, so if the button is held down for longer than a period of time, something happens.
I can use a timer started by OnPress() and on update, accumulate time since it was pressed and test against a threshold. This works except it doesn't register a movement off the button/touch place as a cancel, so a user can press a button, move their finger elsewhere, and the hold still triggers.
How can I test if the finger hasn't moved off the button after touch down?
Note I'm not just using this with buttons with colliders, but also the whole level to set points on the map. In effect, the whole screen is a UI.