// Start is called before the first frame update void Start() { //Player2の得点を取得 int point = GameDirector.Getpoint(); //Player1の得点を取得 int PlayerPoint1 = End1Director.GetPlayerPoint1(); //Player2の得点をそれ用の変数に代入 PlayerPoint2 = point; Debug.Log(PlayerPoint1); Debug.Log(PlayerPoint2); //対戦結果 if (PlayerPoint1 < PlayerPoint2) { this.WinnerText.GetComponent <TextMeshProUGUI>().text = "Player1の勝ち"; } else if (PlayerPoint1 == PlayerPoint2) { this.WinnerText.GetComponent <TextMeshProUGUI>().text = "引き分け"; } else { this.WinnerText.GetComponent <TextMeshProUGUI>().text = "Player2の勝ち"; } //Playerの得点を表示 this.PointText1.GetComponent <TextMeshProUGUI>().text = "Player1:" + PlayerPoint1 + "回"; this.PointText2.GetComponent <TextMeshProUGUI>().text = "Player2:" + PlayerPoint2 + "回"; }
void OnTriggerEnter(Collider other) { //ゴールシーンに移動 int PlayerPoint1 = End1Director.GetPlayerPoint1(); //Player1のポイントでif文 //0ならEndScene1,0以外ならEndScene2 if (PlayerPoint1 == 0) { SceneManager.LoadScene("1stEndScene"); } else { SceneManager.LoadScene("2ndEndScene"); } }