Project
This commit is contained in:
1 parent
e1a474d4ac
commit
24b1157026
164 files changed
+68527
No files matched your search
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using Code.GameplayServices;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Code.UI
|
||||
{
|
||||
public class RestartPanel : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private Button restartButton;
|
||||
[SerializeField] private TMP_Text scoreText;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
restartButton.onClick.AddListener(RestartGame);
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
restartButton.onClick.RemoveListener(RestartGame);
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
ShowScore();
|
||||
}
|
||||
|
||||
private void ShowScore()
|
||||
{
|
||||
scoreText.text = PlayerScoreService.Instance.Score.ToString();
|
||||
}
|
||||
|
||||
private void RestartGame() => GameplayManager.Instance.RestartGame();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 29c7d40f01be4cae9ff1aa28cf88cfe3
|
||||
timeCreated: 1777835101
|
||||
Reference in new issue
Block a user