void OnGUI () {
GUILayout.BeginArea(new Rect(screenW / 4, 100, screenW / 2, screenH /
if(GUILayout.Button(“Change the Server’s IP”)){
//set a user-defined ip address for client to connect
//the default ip is ethernet jack B48 in the CSL lab.
Log.Debug(“reached”);
MyClient.strIP = GUI.TextField(new Rect(screenW/2 - 150, screenH/2 - 75, 300, 150), MyClient.strIP, 15);
}
GUILayout.EndArea();
}
The textfield does not show up after click the button. but console does print “reached” which indicates the button click event is handled. So whats wrong with my code then?
Thank you in advance!
i did as you said. but the new problem is the textfield does not disappear after i hit enter. i tried to set the bool back to false after initiate textfield, but this will prevent textfield from showing up again!
– willkzhangWhy - are you taking the button away? Otherwise clicking it should make it show up again.
– DracoratChange
– dorpelegChangeServerIP = truetoChangeServerIP != ChangeServerIPThis is make it so it can turn the textfield on and off.