I have a GUILayout.Window which appears when the game starts. When the player connects to a server by clicking a button in the window, the window doesn’t disappear as it should. Here is the code inside the OnGUI function which is creating the window:
if(!Network.isClient && !Network.isServer)
{
leftIndent = Screen.width / 2 - connectionWindowWidth / 2;
topIndent = Screen.height / 2 - connectionWindowHeight / 2;
connectionWindowRect = new Rect(leftIndent, topIndent, connectionWindowWidth, connectionWindowHeight);
connectionWindowRect = GUILayout.Window(0, connectionWindowRect, ConnectWindow, titleMessage);
}
I have tried replacing the if statement with a check for the peerType of the network, to no avail.
From this, I have determined that the GUI window isn’t actually there. I think it may be a graphical issue, since I cannot interact with the window in any way. The graphic of the buttons in the window freeze after it should disappear and the white highlight of the window which shows when the window is clicked is not removed when I click off of the window.