Add new auto window open
This commit is contained in:
parent
1abfcc0042
commit
ebfeb14515
@ -152,7 +152,8 @@ namespace NEG.UI
|
||||
{
|
||||
if(CurrentMainWindow != window)
|
||||
return;
|
||||
|
||||
|
||||
CurrentMainWindow = null;
|
||||
//TODO: select new main window
|
||||
}
|
||||
|
||||
|
||||
17
NEG/UI/UnityUi/Area/AutoOpenWindowWhenNoOther.cs
Normal file
17
NEG/UI/UnityUi/Area/AutoOpenWindowWhenNoOther.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
3
NEG/UI/UnityUi/Area/AutoOpenWindowWhenNoOther.cs.meta
Normal file
3
NEG/UI/UnityUi/Area/AutoOpenWindowWhenNoOther.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 473c065573984067a824ebf3b605c3ab
|
||||
timeCreated: 1695048071
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user