29 lines
691 B
C#
29 lines
691 B
C#
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEngine;
|
||
|
|
||
|
public class LeaderboardEntry : MonoBehaviour
|
||
|
{
|
||
|
[SerializeField]
|
||
|
private TMPro.TextMeshProUGUI _numText;
|
||
|
[SerializeField]
|
||
|
private TMPro.TextMeshProUGUI _nameText;
|
||
|
[SerializeField]
|
||
|
private TMPro.TextMeshProUGUI _scoreText;
|
||
|
|
||
|
[SerializeField]
|
||
|
private List<GameObject> _medals = new List<GameObject>();
|
||
|
|
||
|
public void Init(Player player, int index)
|
||
|
{
|
||
|
if (index < 3)
|
||
|
{
|
||
|
_medals[index].SetActive(true);
|
||
|
}
|
||
|
|
||
|
_numText.SetText($"{index + 1}");
|
||
|
_nameText.SetText(player.Name);
|
||
|
_scoreText.SetText($"{player.Score}");
|
||
|
}
|
||
|
}
|