mirror of
https://github.com/ryzij/Cube-Tower-Defense.git
synced 2026-07-14 01:56:57 +00:00
Добавил возможность проиграть
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user