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