AwesomeRunner/Assets/Scripts/UI/Views/PlayerScoreboardCard.cs
2022-08-11 03:37:40 +03:00

24 lines
639 B
C#

using TMPro;
using UnityEngine;
public struct PlayerScoreboardCardData
{
public string playerName;
public string playerScore;
public PlayerScoreboardCardData(string playerName,string playerScore)
{
this.playerName = playerName;
this.playerScore = playerScore;
}
}
public class PlayerScoreboardCard : MonoBehaviour
{
[SerializeField] private TextMeshProUGUI playerName;
[SerializeField] private TextMeshProUGUI playerScore;
public void UpdateCard(PlayerScoreboardCardData data)
{
playerName.text = data.playerName;
playerScore.text = data.playerScore;
}
}