Добавил возможность проиграть

This commit is contained in:
2026-05-16 17:31:11 +03:00
parent 5343e3f459
commit a9b985cfd4
5 changed files with 113 additions and 25 deletions
+21
View File
@@ -3,13 +3,34 @@ using UnityEngine.SceneManagement;
public class GameOverMenu : MonoBehaviour
{
[SerializeField] private Tower _tower;
[SerializeField] private Transform _menuPanel;
private void OnEnable()
{
_tower.OnGameOver += OnGameOver;
}
private void OnDisable()
{
_tower.OnGameOver -= OnGameOver;
}
public void RestartGame()
{
Time.timeScale = 1f;
SceneManager.LoadScene("Island");
}
public void MainMenu()
{
Time.timeScale = 1f;
SceneManager.LoadScene("MainMenu");
}
private void OnGameOver()
{
Time.timeScale = 0f;
_menuPanel.gameObject.SetActive(true);
}
}