Leaderboard
This commit is contained in:
@@ -5,13 +5,17 @@ using TMPro;
|
||||
public class WinScript : MonoBehaviour
|
||||
{
|
||||
public TextMeshProUGUI MainText;
|
||||
public TextMeshProUGUI MainText2;
|
||||
public List<string> leaderboard;
|
||||
public List<string> time;
|
||||
public GameObject winner;
|
||||
|
||||
void Start()
|
||||
{
|
||||
leaderboard = GameObject.Find("GameManager").GetComponent<GameManager>().playersFinished;
|
||||
time = GameObject.Find("GameManager").GetComponent<GameManager>().playerTimes;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -19,10 +23,15 @@ public class WinScript : MonoBehaviour
|
||||
private void Update()
|
||||
{
|
||||
MainText.text = "Leaderboard: ";
|
||||
MainText2.text = "\n";
|
||||
for (var i = 0; i < leaderboard.Count; i++){
|
||||
MainText.text += "\n" + (i+1) + "." + leaderboard[i] + "(" + time[i] + ")";
|
||||
MainText.text += "\n" + (i+1) + "." + leaderboard[i];
|
||||
MainText2.text += "\n(" + time[i] + ")";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user