So my problem is that no matter where the user clicks, the toggle thinks it has been clicked…
The part of the code with the 2 toggles acting like radio buttons (they are in a small window)
function connect() {
GUILayout.BeginVertical();
GUILayout.BeginHorizontal();
GUILayout.Label("IP: ");
ip = GUILayout.TextField(ip, GUILayout.Width(120));
GUILayout.EndHorizontal();
GUILayout.BeginHorizontal();
GUILayout.Label("Name: ");
_name = GUILayout.TextField(_name, GUILayout.Width(120));
GUILayout.EndHorizontal();
if ( GUILayout.Button("Connect") ) {
Debug.Log("Connecting...");
Network.Connect(ip, 25000, "superSecret");
}
isKnight = GUILayout.Toggle(isKnight , "Lizard");
isKnight = GUILayout.Toggle(!isKnight , "Knight");
GUILayout.EndVertical();
GUI.DragWindow(connectRect);
}