void NextRound() { if (round > 9) { my_scoreboard.transform.GetChild(2).gameObject.SetActive(false); opponent_scoreboard.transform.GetChild(2).gameObject.SetActive(false); } chooseTimer = 5; role1 = (Role)GameManager.manager._root_round_data.data.role; InitGame((Role)GameManager.manager._root_round_data.data.role); MeTieRound.GetComponent <Image>().sprite = Result[GameManager.manager._root_round_data.data.score.round[5].round_score]; OppTieRound.GetComponent <Image>().sprite = Result[GameManager.manager._root_round_data.data.opponent_score.round[5].round_score]; if (my_scoreboard != null) { my_scoreboard.transform.GetChild(0).GetComponent <Text>().text = GameManager.manager._root_round_data.data.score.total.ToString(); opponent_scoreboard.transform.GetChild(0).GetComponent <Text>().text = GameManager.manager._root_round_data.data.opponent_score.total.ToString(); for (int i = 0; i < GameManager.manager._root_round_data.data.score.round.Length - 1; i++) { for (int j = 1; j < 3; j++) { if (GameManager.manager._root_round_data.data.score.round[i].round_score == j) { //Debug.Log(GameManager.manager._root_round_data.data.score.round[i].round_score); // my_scoreboard.transform.GetChild(2).GetChild(4 - i).GetComponent<Image>().sprite = Result[j]; my_scoreboard.transform.GetChild(2).GetChild(i).GetComponent <Image>().sprite = Result[j]; } } } for (int i = 0; i < GameManager.manager._root_round_data.data.opponent_score.round.Length - 1; i++) { for (int j = 1; j < 3; j++) { if (GameManager.manager._root_round_data.data.opponent_score.round[i].round_score == j) { opponent_scoreboard.transform.GetChild(2).GetChild(i).GetComponent <Image>().sprite = Result[j]; // Debug.Log(GameManager.manager._root_round_data.data.opponent_score.round[i].round_score); } } } } GameManager.manager.next_round = false; }
void GameOver() { MeTieRound.GetComponent <Image>().sprite = Result[GameManager.manager._root_round_data.data.score.round[5].round_score]; OppTieRound.GetComponent <Image>().sprite = Result[GameManager.manager._root_round_data.data.opponent_score.round[5].round_score]; if (my_scoreboard != null) { my_scoreboard.transform.GetChild(0).GetComponent <Text>().text = GameManager.manager._root_round_data.data.score.total.ToString(); opponent_scoreboard.transform.GetChild(0).GetComponent <Text>().text = GameManager.manager._root_round_data.data.opponent_score.total.ToString(); for (int i = 0; i < GameManager.manager._root_round_data.data.score.round.Length - 1; i++) { for (int j = 1; j < 3; j++) { if (GameManager.manager._root_round_data.data.score.round[i].round_score == j) { //Debug.Log(GameManager.manager._root_round_data.data.score.round[i].round_score); // my_scoreboard.transform.GetChild(2).GetChild(4 - i).GetComponent<Image>().sprite = Result[j]; my_scoreboard.transform.GetChild(2).GetChild(i).GetComponent <Image>().sprite = Result[j]; } } } for (int i = 0; i < GameManager.manager._root_round_data.data.opponent_score.round.Length - 1; i++) { for (int j = 1; j < 3; j++) { if (GameManager.manager._root_round_data.data.opponent_score.round[i].round_score == j) { opponent_scoreboard.transform.GetChild(2).GetChild(i).GetComponent <Image>().sprite = Result[j]; // Debug.Log(GameManager.manager._root_round_data.data.opponent_score.round[i].round_score); } } } } SceneManager.LoadScene("Result", LoadSceneMode.Single); GameManager.manager.next_round = false; GameManager.manager.game_over = false; }