private void Update() { if (IsInRoom && (ConnectPanelIsActive || redrawNeeded)) { UIController.ActivateRoomPanel(client.CurrentRoom.Name); var playerNames = GetPlayerNames(); UIController.SetPlayerNames(playerNames); } else if (!IsInRoom && (!ConnectPanelIsActive || redrawNeeded)) { UIController.ActivateConnectPanel(); UIController.ClearRoomButtonText(); foreach (var room in rooms) { UIController.AddRoomButton(room.Value.Name, room.Value.PlayerCount, room.Value.MaxPlayers); } } }