void OnGUI() { GUI.depth = 10; GUI.skin = GameCreationMenuSkin; GUI.BeginGroup(new Rect(0, 0, Screen.width, Screen.height)); GUI.DrawTexture(new Rect(0, 0, Screen.width, Screen.height), Background); if (GUI.Button(new Rect(Screen.width / 25, Screen.height / 25, Properties.BackButtonSize, Properties.BackButtonSize), Properties.BackButton)) { MainMenu.Show(); Hide(); } float offset = Screen.height / 20; GUI.DrawTexture(new Rect(Screen.width / 2 - LOGO_SIZE, offset, LOGO_SIZE * 2, LOGO_SIZE), Logo); offset += LOGO_SIZE + offset; float button_size = Screen.width / 9 * 4; GUI.Box(new Rect(Screen.width / 2 - button_size, offset, button_size * 2, Properties.TEXT_HEIGHT * 2), LanguageManager.getString("GMENDCNDTN")); offset += Properties.TEXT_HEIGHT * 2 + Properties.TEXT_HEIGHT / 3; gameTypeSelection = GUI.SelectionGrid(new Rect(Screen.width / 2 - button_size, offset, button_size * 2, Properties.TEXT_HEIGHT * 2), gameTypeSelection, selStrings, 2); offset += Properties.TEXT_HEIGHT * 3; string condition = string.Empty; if (gameTypeSelection == 0) { condition = LanguageManager.getString("HNDCNT"); } else { condition = LanguageManager.getString("TRGTSCR"); } GUI.Box(new Rect(Screen.width / 2 - button_size - Screen.width / 40, offset, button_size, Properties.TEXT_HEIGHT * 2), condition); gameGoal = GUI.TextField(new Rect(Screen.width / 2 + Screen.width / 40, offset, button_size, Properties.TEXT_HEIGHT * 2), gameGoal); bool isValid = ValidateGoalInput(); offset += Properties.TEXT_HEIGHT * 3; if (GUI.Button(new Rect(Screen.width / 2 - button_size / 2, offset, button_size, Properties.TEXT_HEIGHT * 2), LanguageManager.getString("STRTGM")) && isValid) { LoadingScreen.Show(); Properties.ActiveGameType = GameType.SinglePlayer; MultiplayerObjects.gameObject.SetActive(false); TrumpSelection.Hide(); ScoreBoard.Hide(); PlayerStats.Show(); UIGameTable.CleanTable(); StartCoroutine(StartSinglePlayerGame()); } GUI.EndGroup(); }
void Update() { if (Input.GetKeyDown(KeyCode.Escape)) { InGameMenu.Show(); } if (dataNewlyBound) { dataNewlyBound = false; MultiplayerGamers.ResetPlayers(); UIGameTable.CleanTable(); // GET CURRENT PLAYER SEATS object seat0, seat1, seat2, seat3; if (RoomProperties.TryGetValue("SEAT0", out seat0)) { MultiplayerGamers.UserJoined(seat0.ToString(), 0, seat0.ToString().Equals(player.GetInternalPlayer().PlayerName)); } if (RoomProperties.TryGetValue("SEAT1", out seat1)) { MultiplayerGamers.UserJoined(seat1.ToString(), 1, seat1.ToString().Equals(player.GetInternalPlayer().PlayerName)); } if (RoomProperties.TryGetValue("SEAT2", out seat2)) { MultiplayerGamers.UserJoined(seat2.ToString(), 2, seat2.ToString().Equals(player.GetInternalPlayer().PlayerName)); } if (RoomProperties.TryGetValue("SEAT3", out seat3)) { MultiplayerGamers.UserJoined(seat3.ToString(), 3, seat3.ToString().Equals(player.GetInternalPlayer().PlayerName)); } object gameType, gameGoal; if (RoomProperties.TryGetValue("TYPE", out gameType)) { if (gameType.ToString() == "0") { MultiplayerManager.CurrentEndCondition = Common.Enums.GameMode.RoundCount; } else { MultiplayerManager.CurrentEndCondition = Common.Enums.GameMode.TargetScore; } } if (RoomProperties.TryGetValue("GOAL", out gameGoal)) { MultiplayerManager.CurrentEndConditionGoal = gameGoal; } } }