- Home /
GUI Windows not being removed properly in a network
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.
ALSO: The problem only occurs in a built game, not in the playmode within unity. I occurs when the built game is server and when it is the client.
Your answer
Follow this Question
Related Questions
Why does the font selected for my GUI Skin not display correctly? 1 Answer
v4.6 UI Element's Positioning Incorrect 1 Answer
Bug: GUI.changed inconsistently works 0 Answers
How can you hide "Development Build" text? (without unchecking) 0 Answers
Sometimes I get a bug with GUI. Focus received another field. 0 Answers