using TMPro;
using UnityEngine;

[RequireComponent(typeof(TextMeshProUGUI))]
public class EndOfGameUIText : MonoBehaviour
{
    private TextMeshProUGUI _textComponent;

    private void Awake()
    {
        _textComponent = GetComponent<TextMeshProUGUI>();

        var result = PlayerPrefs.GetString("LastResult");
        result = result.Remove(result.Length - 1, 1);
        result = result.Replace(",", ", ");

        _textComponent.text = string.Format(_textComponent.text, result);
    }
}
