Что я сдал
This commit is contained in:
1 parent
24b1157026
commit
a5665f0101
2838 files changed
+129953
-1304
No files matched your search
@@ -1,4 +1,3 @@
|
||||
using System;
|
||||
using Code.GameplayServices;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
@@ -9,16 +8,22 @@ namespace Code.UI
|
||||
public class RestartPanel : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private Button restartButton;
|
||||
[SerializeField] private Button showScoresPanel;
|
||||
[SerializeField] private ScoreTable scoreTable;
|
||||
[SerializeField] private TMP_Text scoreText;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
restartButton.onClick.AddListener(RestartGame);
|
||||
showScoresPanel.onClick.AddListener(PlayerScoreService.Instance.ShowScoreTable);
|
||||
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
restartButton.onClick.RemoveListener(RestartGame);
|
||||
showScoresPanel.onClick.RemoveListener(PlayerScoreService.Instance.ShowScoreTable);
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
@@ -31,6 +36,10 @@ namespace Code.UI
|
||||
scoreText.text = PlayerScoreService.Instance.Score.ToString();
|
||||
}
|
||||
|
||||
private void RestartGame() => GameplayManager.Instance.RestartGame();
|
||||
private void RestartGame()
|
||||
{
|
||||
GameplayManager.Instance.RestartGame();
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user