Add new auto window open

This commit is contained in:
Hubert Mattusch 2023-09-19 12:42:51 +02:00
parent 1abfcc0042
commit ebfeb14515
4 changed files with 28 additions and 1 deletions

View File

@ -152,7 +152,8 @@ namespace NEG.UI
{
if(CurrentMainWindow != window)
return;
CurrentMainWindow = null;
//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 OnDestroy()
{
if(gameObject.activeSelf)
UiManager.Instance.OnWindowClosed(this);
}
private void OnValidate()
{
#if !NEG_UI_DISABLE_WARNING_DEFAULT_SELECTION