Search Unity

Does an edited "UI.Button" exists somewhere?

Discussion in 'UI Toolkit' started by SalvoSoftware, Jun 10, 2020.

  1. SalvoSoftware

    SalvoSoftware

    Joined:
    Feb 4, 2013
    Posts:
    9
    Hi!
    I'm working on the UI and I needed a button that calls two different methods (actually the same method but with different parameters) when you start pressing it and when you release it.

    I already done this on Android using TriggerEvent. I've put no function inside the "OnClick" of the button but I've put the two actions on OnPointerDown/OnPointerUp of the TriggerEvent.

    This works perfectly on Android or using the Mouse, but doesn't work with Keyboard and Gamepad.
    Can I edit the standard UI Button to make it as I wish or does an edited version of it exists already?

    Thanks!

    I know I could use Input to detect when the "Submit" key have been pressed, but I'm curious to see if this can be implemented directly in the button or using a custom TriggerEvent.