I am writing a GUI application for Unity and I have text box showing which is great but for some reason I can't enter any kind of text into it.
Here is the class:
///
/// Main function where the GUI windows are created
///
///
void OnGUI()
{
MyFirstWindow();
}
///
/// Displays the background survey that the user will fill out
///
void MyFirstWindow()
{
int windowWidth = 800;
int windowHeight = 600;
//// Make a background box
GUI.Box(new Rect((Screen.width / 2) - (windowWidth / 2),
(Screen.height / 2) - (windowHeight / 2),
windowWidth, windowHeight),
"Hello World!");
string txtAge = "";
txtAge = GUI.TextField(new Rect(600, 355, 50, 40), txtAge, 2);
}
↧