Quantcast
Channel: Questions in topic: "get"
Viewing all articles
Browse latest Browse all 215

Get score from list?

$
0
0
hey gang trying to display scores from my list, should be a simple thing haven't been able to get it to work was wondering how i can get it. however its not displaying anything in my text. :( should be something like FistPlace.text = scoresList[0].ToString(); public class ScoreTRacker : Photon.MonoBehaviour { public List scoresList; public int Player1Score = 1000; public int Player2Score= 4000; public int Player3Score= 2000; public int Player4Score= 3000; public Text FistPlace; public Text SecondPlace; public Text FourthPlace; public Text ThirdPlace; void EndGame(){ scores.Add(Player1Score); scoresList.Add(Player2Score); scoresList.Add(Player3Score); scoresList.Add(Player4Score); scoresList.sort(); // put in order } void Update(){ int one = 0; int two = 1; int three = 2; int four = 3; // display in order from first in list to last.... FistPlace.text = scoresList[one].ToString(); SecondPlace.text = scoresList[two].ToString(); ThirdPlace.text = scoresList[three.ToString(); FourthPlace.text = scoresList[four].ToString(); }

Viewing all articles
Browse latest Browse all 215

Trending Articles