22 lines
522 B
C#
Raw Normal View History

2025-09-06 17:17:39 +04:00
using UnityEngine;
using TMPro;
public class PlayerScore : MonoBehaviour
{
private TextMeshProUGUI scoreText;
private float internalScore;
private int currentScoreValue;
private void Awake()
{
scoreText = GetComponent<TextMeshProUGUI>();
}
void Update()
{
internalScore = Mathf.Lerp(internalScore, Player.Instance.score, 10f * Time.deltaTime);
currentScoreValue = Mathf.RoundToInt(internalScore);
scoreText.text = currentScoreValue.ToString();
}
}