using a button witout pressing it ?
so i have made a UI With a back button that disables and enables different gameobjects holding the new page of the ui standard way , andy way basically what i want to is to attach a script to the button gameobject that takes the button component and apply the commands that are set for the onclick without clicking the button but with the input of the return key if(Input.Input.GetButtonDown(return)) { apply the button code }
so how can i do this ?
Answer by Statement · Oct 24, 2015 at 02:39 PM
if (Input.GetButtonDown(someKey)) { button.onClick.Invoke(); }
You can see how Unity implements click handling in their open source bitbucket repo.
Your answer
Follow this Question
Related Questions
With the new unity input system. How do I setup UI buttons like in the old system. 0 Answers
Is it possible to get the screen rect for a button regardless of its parent? 1 Answer
CrossPlatformInput Detect Multiple Input Headache 1 Answer
Porting to mobile how to assign input manager axes to GUIButtons. 0 Answers