void CheckWinner() { if (playerChoose == botChoose) { //draw WinnerText.GetComponent <Text>().text = "DRAW!"; } else if ((playerChoose == 1 && botChoose == 3) || (playerChoose == 2 && botChoose == 1) || (playerChoose == 3 && botChoose == 2)) { //player wins WinnerText.GetComponent <Text>().text = "YOU WIN!"; winCount++; WinCountText.GetComponent <Text>().text = "Wins: " + winCount; } else { //player loses WinnerText.GetComponent <Text>().text = "YOU LOSE!"; } count++; CountText.GetComponent <Text>().text = "Games Played: " + count; }
// Update is called once per frame void Update() { WinCountText.GetComponent <Text>().text = "Wins: " + winCount; roundScoreText.text = "Round Wins: " + roundWinCount; if (playersTurn && playerChoose == -1) { return; } BotChoose(); CheckWinner(); playerChoose = -1; playersTurn = true; // Who won that round if (count == 10) { if (winCount > 1) { roundWinCount++; } reset(); } }