```
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");
}
}
```
↧