private void updateScores() { // As implied by the name, simply changes sends the values contained // in the playerXScore variables to the objects player playerXScoreText PlayerOneScoreText.text = PlayerOneScore.ToString(); PlayerTwoScoreText.text = PlayerTwoScore.ToString(); }
public void PlayerTwo() //Слежение за первым игроком { PlayerTwoScore++; ScoreTwo.text = "<color=blue>" + PlayerTwoScore.ToString() + "</color>"; if (PlayerTwoScore == 8) //Победа второго игрока { NextRound.text = "<color=blue>VICTORY</color>"; exi.text = "<color=blue>EXIT</color>"; retur.text = "<color=blue>RETURN</color>"; Instantiate(RoundNow, new Vector3(0f, 2f, 0f), Quaternion.identity, canvas.GetComponent <Transform>()); Instantiate(NamePlayer2, new Vector3(0f, 0.5f, 0f), Quaternion.identity, canvas.GetComponent <Transform>()); Instantiate(ex, new Vector3(0f, -3.5f, 0f), Quaternion.identity, canvas.GetComponent <Transform>()); Instantiate(ret, new Vector3(0f, -2f, 0f), Quaternion.identity, canvas.GetComponent <Transform>()); Instantiate(BackPlate, new Vector3(0f, 0f, 0f), Quaternion.identity); Instantiate(ExitGround, new Vector3(0f, 0f, 0f), Quaternion.identity); Time.timeScale = 0f; } else { Invoke("ControlRounds", 0.1f); Invoke("Respawn", 0.1f); } }