diff --git a/Assets/Scripts/Infrastructure/Unity/GameBootstrap.cs b/Assets/Scripts/Infrastructure/Unity/GameBootstrap.cs index 5847c72..d49687e 100644 --- a/Assets/Scripts/Infrastructure/Unity/GameBootstrap.cs +++ b/Assets/Scripts/Infrastructure/Unity/GameBootstrap.cs @@ -22,6 +22,7 @@ namespace Infrastructure.Unity [SerializeField] private HunterNpcController hunterNpcPrefab; [SerializeField] private FloorVisibilityManager floorVisibilityManager; + [Header("Ui")] [SerializeField] private GameUiCoordinator uiCoordinator; [Header("Settings")] diff --git a/Assets/Scripts/Infrastructure/Unity/GameUiCoordinator.cs b/Assets/Scripts/Infrastructure/Unity/GameUiCoordinator.cs index e1608b4..791cbd5 100644 --- a/Assets/Scripts/Infrastructure/Unity/GameUiCoordinator.cs +++ b/Assets/Scripts/Infrastructure/Unity/GameUiCoordinator.cs @@ -23,6 +23,13 @@ namespace Infrastructure.Unity session.OnGameOver += ShowGameOverUi; } + private void OnDestroy() + { + if (_session == null) return; + _session.OnScoreChanged -= UpdateScore; + _session.OnGameOver -= ShowGameOverUi; + } + public void ShowStartScreen() { if (gameOverUi) gameOverUi.SetActive(false);