How to catch UI button click without using On Click?
Such a situation that it is necessary to do just that. In short - in fact, I need that pressing the UI button is equivalent to pressing a key on the keyboard.
Answering the question in the title - throw a raycast from the click point and see where it hits.
But here I can’t understand at all what prevents using OnClick with a condition
You have handlers - keyboards, UI, and they pull the same function.