I want to simulate pressing space by button from new UI. What I thought is to create new bool variable and connect it to button from UI. But how to do it? I want bool=true as long as button pressed, and bool=false - when released.
thanks
1 Answer
1bool _pressed = false;
void OnGUI ()
{
GUI.Box(new Rect(10,10,180,80), "Debug Menu");
_pressed = GUI.Button(new Rect(20,40,160,20), "Space");
}
Thanks. But this is old way. I need solution for new 4.6 unity .
– Slava_FAh I apologize. I misread your question. Sorry!
– Andrew_Kenady