mirror of
https://github.com/ryzij/Cube-Tower-Defense.git
synced 2026-07-14 01:56:57 +00:00
Исправил баг
This commit is contained in:
@@ -12,6 +12,7 @@ public class GameMenuButtons : MonoBehaviour
|
|||||||
private void OnEnable()
|
private void OnEnable()
|
||||||
{
|
{
|
||||||
_gameManager.OnStateChanged += OnStateChanged;
|
_gameManager.OnStateChanged += OnStateChanged;
|
||||||
|
_gameManager.OnLevelChanged += OnLevelChanged;
|
||||||
_mainMenuButton.onClick.AddListener(ExitToMainMenu);
|
_mainMenuButton.onClick.AddListener(ExitToMainMenu);
|
||||||
|
|
||||||
if (_resetPathButton != null)
|
if (_resetPathButton != null)
|
||||||
@@ -21,6 +22,7 @@ public class GameMenuButtons : MonoBehaviour
|
|||||||
private void OnDisable()
|
private void OnDisable()
|
||||||
{
|
{
|
||||||
_gameManager.OnStateChanged -= OnStateChanged;
|
_gameManager.OnStateChanged -= OnStateChanged;
|
||||||
|
_gameManager.OnLevelChanged -= OnLevelChanged;
|
||||||
_mainMenuButton.onClick.RemoveListener(ExitToMainMenu);
|
_mainMenuButton.onClick.RemoveListener(ExitToMainMenu);
|
||||||
|
|
||||||
if (_resetPathButton != null)
|
if (_resetPathButton != null)
|
||||||
@@ -38,6 +40,11 @@ public class GameMenuButtons : MonoBehaviour
|
|||||||
_resetPathButton = null;
|
_resetPathButton = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnLevelChanged(GameManager.OnLevelChangedEventArgs args)
|
||||||
|
{
|
||||||
|
_nextLevelButton.interactable = !args.IsLastLevel;
|
||||||
|
}
|
||||||
|
|
||||||
private void OnResetButtonClick()
|
private void OnResetButtonClick()
|
||||||
{
|
{
|
||||||
_sandPathBuildService.ResetPath();
|
_sandPathBuildService.ResetPath();
|
||||||
|
|||||||
Reference in New Issue
Block a user