Добавил меню победы

This commit is contained in:
2026-05-25 01:36:06 +03:00
parent 1b62e82dd9
commit 90a4573380
2 changed files with 84 additions and 6 deletions
+4 -4
View File
@@ -3,17 +3,17 @@ using UnityEngine.SceneManagement;
public class GameOverMenu : MonoBehaviour
{
[SerializeField] private Tower _tower;
[SerializeField] private WinLoseController _winLoseController;
[SerializeField] private Transform _menuPanel;
private void OnEnable()
{
_tower.OnGameOver += OnGameOver;
_winLoseController.OnGameOver += OnGameOver;
}
private void OnDisable()
{
_tower.OnGameOver -= OnGameOver;
_winLoseController.OnGameOver -= OnGameOver;
}
public void RestartGame()
@@ -28,7 +28,7 @@ public class GameOverMenu : MonoBehaviour
SceneManager.LoadScene("MainMenu");
}
private void OnGameOver()
private void OnGameOver(WinLoseController.OnGameOverEventArgs args)
{
Time.timeScale = 0f;
_menuPanel.gameObject.SetActive(true);