- Home /
Catch all inputs on a button before selection change
We are about to implement Controller and Touch Input at the same time and I have some issues with that.
I have two buttons, Button 1 and Button 2.
button 1 is selected. I want to ignore button 2 based on some conditions (e.g. not bought) and keep button 1 stay selected in that case. I managed to catch all navigations by overriding the UI Button hooking into the Move Method (thanks to the Open Sourced code).
However catching mouse input on button 2 and NOT loosing selection status on button 1, I couldn't get that to work.
I dug into the StandaloneInputModule and only found, that completely copying the necessary method (ProcessMouseEvent) into a derived class, marking it with the "new" modifier, was just ignored by the engine not calling it.
A handling within the buttons (OnSelect OnDeselect), giving back focus to the former from the blocked one (from button 2 back to button 1) was not working either, because calling "Select" right in OnSelect was canceled due to "alreadySelecting" in the EventSystem
I don't know what to do. I'm really stuck here and would appreciate any help