Gui button up?

public void OnGUI(){
        if (GUI.Button (new Rect (Screen.width * 0.85f, Screen.height * 0.05f, Screen.width * 0.10f, Screen.width * 0.05f), "Go")) {
            print ("button down");
        } else {
            print ("button up");
        }

I am trying to detect when a GUI button is held down, and when it is not currently being held down… Anyone know how this works in C#?

Thanks

if(Event.current.type == EventType.MouseDown && rect.Contains(Event.current.MousePosition))
1 Like

Gui. RepeatButton

1 Like