25 lines
988 B
C#
25 lines
988 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
|
|
public class LeaderboardDeathmatch : MonoBehaviour
|
|
{
|
|
public Transform ListParent;
|
|
|
|
public void Populate(PlayerNetwork[] list){
|
|
for(int i=0;i < ListParent.childCount; i++){
|
|
if(list.Length > i){
|
|
ListParent.GetChild(i).gameObject.SetActive(true);
|
|
ListParent.GetChild(i).GetChild(0).GetComponent<TMP_Text>().text = list[list.Length-1-i].username;
|
|
ListParent.GetChild(i).GetChild(1).GetComponent<TMP_Text>().text = list[list.Length-1-i].kills.ToString();
|
|
ListParent.GetChild(i).GetChild(2).GetComponent<TMP_Text>().text = list[list.Length-1-i].deaths.ToString();
|
|
ListParent.GetChild(i).GetChild(3).GetComponent<TMP_Text>().text = list[list.Length-1-i].assists.ToString();
|
|
|
|
}else{
|
|
ListParent.GetChild(i).gameObject.SetActive(false);
|
|
}
|
|
}
|
|
}
|
|
}
|