//Display highestscore at the end of the round void GetHighscore() { Scoreinfo scoreinfo = OrderScores(scores.ToArray(), playernames.ToArray()); winnerName_Text.text = scoreinfo.orderedplayernames[0].ToString(); winnerScore_Text.text = "with " + scoreinfo.orderedscores[0].ToString() + " points"; winner_Frame.SetActive(true); time_Text.text = "Starting next round"; }
void OnGUI() { if (newplayer != null && playerScore != null) { ownScore_Text.text = "Score: " + (playerScore.score).ToString(); } for (n = 0; n < playernames.Count; n++) { //this statement designates the current player if (n == playerNumber - 1) { scores[n] = playerScore.score; playernames [n] = playerInfo.playerName; photonView.RPC("PlayerInformation", PhotonTargets.All, scores [n], playernames [n], n); } } if (Input.GetKey(KeyCode.Tab)) { //network array passed through function so the ordered version doesn't //reference and tamper with the original Scoreinfo scoreinfo = OrderScores(scores.ToArray(), playernames.ToArray()); for (int n = 0; n < playernames.Count; n++) { scoreboardx = Screen.width / 2 - 100; scoreboardy = (n + 1) * 40 + 100; scoreboardwidth = 200; scoreboardheight = 40; //this statement designates the current player if (scoreinfo.orderedplayernames[n] == playerInfo.playerName) { GUI.color = Color.yellow; } else { GUI.color = Color.white; } GUI.Box(new Rect(scoreboardx, scoreboardy, scoreboardwidth, scoreboardheight), (n + 1) + ". " + scoreinfo.orderedplayernames[n] + ": " + scoreinfo.orderedscores[n]); } } }