public void CheckForWinner() { if (gameSession == null) { return; } int winner = -1; // 0 or 1 for player (zero-indexed), -1 for no winner. RoundupInfo info = new RoundupInfo(); if (players[0].tower.GetCompletedWinSegment()) { winner = 0; info.winningPlayerText = "Player 1"; } else if (players[1].tower.GetCompletedWinSegment()) { winner = 1; info.winningPlayerText = "Player 2"; } if (winner != -1) { gameSession.SetState(GameSession.GameplayState.Roundup, info); } }
void Setup_Roundup(Object data = null) { SetCanUpdates(false); AudioSource.PlayClipAtPoint(victoryClip, Vector3.zero); roundupPanel.SetActive(true); RoundupInfo info = data as RoundupInfo; winningPlayerNameText.text = info.winningPlayerText; }