Fix for error on close

This commit is contained in:
Hubert Mattusch 2024-03-02 23:58:48 +01:00
parent f8d8b9fd12
commit 20e281f9dd
2 changed files with 6 additions and 1 deletions

View File

@ -29,6 +29,8 @@ namespace NEG.UI.Area
private void OnDestroy()
{
if(UiManager.Instance == null)
return;
if (ReferenceEquals(UiManager.Instance.CurrentArea, this))
UiManager.Instance.CurrentArea = null;
}

View File

@ -27,7 +27,10 @@ namespace NEG.UI.UnityUi.Window
private void OnDestroy()
{
if (IsOpened) UiManager.Instance.OnWindowClosed(this);
if(UiManager.Instance == null)
return;
if (IsOpened)
UiManager.Instance.OnWindowClosed(this);
}
private void OnValidate()