27 lines
617 B
C#

using TMPro;
using UnityEngine;
using UnityEngine.SceneManagement;
public class MenuScript : MonoBehaviour
{
[SerializeField] private int _BestScore;
[SerializeField] private TextMeshProUGUI _TextScore;
private void OnEnable()
{
_BestScore = PlayerPrefs.GetInt("Best score");
_TextScore.text = "Лучший счёт - " + _BestScore;
}
// Start is called before the first frame update
public void RestartGame()
{
SceneManager.LoadSceneAsync(SceneManager.GetActiveScene().name);
}
public void ExitGame()
{
Application.Quit();
}
}