public void updateValue(int amountIncrease, int playerIndex)
{
scoreSystem[playerIndex].playerScore += amountIncrease;
for (int i = 0; i < scoreSystem.Length; i++)
{
if (scoreSystem[i].player == null)
{
break;
}
if (scoreSystem[i].playerTxt[playerIndex] != null)
{
scoreSystem[i].playerTxt[playerIndex].text = "Player " + (playerIndex + 1) + " " + scoreSystem[playerIndex].playerScore;;
}
else
{
break;
}
}
//Added a print statement for end game condition ~ Sean
// if(scoreSystem[playerIndex].playerScore >= 80)
// {
// print ("Player: " + (playerIndex + 1) + " has won the game");
// gameEndText.text = "Player: " + (playerIndex + 1) + " has won the game";
// StartCoroutine(restartWorld());
// }
Rpc_updateClientValue(scoreSystem[playerIndex].playerScore, playerIndex);
}