Quantcast
Channel: Questions in topic: "gui"
Viewing all articles
Browse latest Browse all 125

My gui box will not disappear on keyboard input.

$
0
0
``` bool showConsole = true; string input; private void OnGUI() { if (Input.GetKeyDown(KeyCode.F3)) { showConsole = !showConsole; } { if (!showConsole) {return;} float y = 0f; GUI.Box(new Rect(0, y, Screen.width, 40), "Debug Console"); GUI.backgroundColor = new Color(0, 0, 0, 0); input = GUI.TextField(new Rect(10f, y + 5f, Screen.width - 20f, 20f), input); } if (showConsole) { Debug.Log("Debug Console Shown"); } else { Debug.Log("Debug Console Hidden"); } } ```

Viewing all articles
Browse latest Browse all 125

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>