fix: unsubscribe UI events on destroy, add Ui header in GameBootstrap
This commit is contained in:
@@ -22,6 +22,7 @@ namespace Infrastructure.Unity
|
||||
[SerializeField] private HunterNpcController hunterNpcPrefab;
|
||||
[SerializeField] private FloorVisibilityManager floorVisibilityManager;
|
||||
|
||||
[Header("Ui")]
|
||||
[SerializeField] private GameUiCoordinator uiCoordinator;
|
||||
|
||||
[Header("Settings")]
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user