ui-system-fix #4

Merged
BitterSmile merged 12 commits from ui-system-fix into main 2024-02-12 19:06:53 +01:00
4 changed files with 28 additions and 1 deletions
Showing only changes of commit ebfeb14515 - Show all commits

View File

@ -152,7 +152,8 @@ namespace NEG.UI
{ {
if(CurrentMainWindow != window) if(CurrentMainWindow != window)
return; return;
CurrentMainWindow = null;
//TODO: select new main window //TODO: select new main window
} }

View File

@ -0,0 +1,17 @@
using NEG.UI.UnityUi.Window;
using NEG.UI.Window;
using UnityEngine;
namespace NEG.UI.Area
{
public class AutoOpenWindowWhenNoOther : MonoBehaviour
{
[SerializeField] private MonoWindow window;
private void Start()
{
if(UiManager.Instance.CurrentMainWindow == null)
window.Open();
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 473c065573984067a824ebf3b605c3ab
timeCreated: 1695048071

View File

@ -55,6 +55,12 @@ namespace NEG.UI.UnityUi.Window
private void Awake() => ((IWindow)this).SetHiddenState(); private void Awake() => ((IWindow)this).SetHiddenState();
private void OnDestroy()
{
if(gameObject.activeSelf)
UiManager.Instance.OnWindowClosed(this);
}
private void OnValidate() private void OnValidate()
{ {
#if !NEG_UI_DISABLE_WARNING_DEFAULT_SELECTION #if !NEG_UI_DISABLE_WARNING_DEFAULT_SELECTION