35 lines
911 B
C#
35 lines
911 B
C#
using NEG.UI.UnityUi.WindowSlot;
|
|
using NEG.UI.Window;
|
|
|
|
namespace NEG.UI.WindowSlot
|
|
{
|
|
public class SingleWindowSlot : MonoWindowSlot
|
|
{
|
|
private IWindow currentWindow;
|
|
|
|
public IWindow CurrentWindow
|
|
{
|
|
get => currentWindow;
|
|
protected set
|
|
{
|
|
currentWindow?.SetClosedState();
|
|
currentWindow = value;
|
|
}
|
|
}
|
|
|
|
public override void AttachWindow(IWindow window, object data)
|
|
{
|
|
CurrentWindow = window;
|
|
window.SetOpenedState(this, data);
|
|
}
|
|
|
|
public override void DetachWindow(IWindow window)
|
|
{
|
|
if (UiManager.Instance.CurrentMainWindow == window)
|
|
UiManager.Instance.MainWindowClosed(window);
|
|
CurrentWindow = null;
|
|
}
|
|
|
|
public override void CloseAllWindows() => CurrentWindow = null;
|
|
}
|
|
} |