31 lines
830 B
C#
31 lines
830 B
C#
using NEG.UI.UnityUi.WindowSlot;
|
|
using NEG.UI.Window;
|
|
using UnityEngine;
|
|
|
|
namespace NEG.UI.WindowSlot
|
|
{
|
|
public class SingleWindowSlot : MonoWindowSlot
|
|
{
|
|
public IWindow CurrentWindow
|
|
{
|
|
get => currentWindow;
|
|
set
|
|
{
|
|
currentWindow?.SetClosedState();
|
|
currentWindow = value;
|
|
currentWindow?.SetOpenedState(this);
|
|
}
|
|
}
|
|
|
|
private IWindow currentWindow;
|
|
|
|
public override void AttachWindow(IWindow window, object data)
|
|
{
|
|
CurrentWindow = window;
|
|
window.FireOpenCallback(data);
|
|
}
|
|
|
|
public override void DetachWindow(IWindow window) => CurrentWindow = null;
|
|
public override void CloseAllWindows() => CurrentWindow = null;
|
|
}
|
|
} |