30 lines
686 B
C#
30 lines
686 B
C#
using NEG.UI.Area;
|
|
using NEG.UI.Popup;
|
|
using NEG.UI.WindowSlot;
|
|
using System;
|
|
using UnityEngine;
|
|
|
|
namespace NEG.UI.Window
|
|
{
|
|
public class MonoWindow : MonoBehaviour, IWindow
|
|
{
|
|
public IWindowSlot Parent { get; private set; }
|
|
public IArea ChildWindowArea => childWindowArea;
|
|
|
|
[SerializeField] private MonoArea childWindowArea;
|
|
|
|
void IWindow.Open(IWindowSlot parentSlot)
|
|
{
|
|
gameObject.SetActive(true);
|
|
Parent = parentSlot;
|
|
}
|
|
|
|
void IWindow.Close()
|
|
{
|
|
gameObject.SetActive(false);
|
|
Parent = null;
|
|
}
|
|
|
|
private void Awake() => ((IWindow)this).Close();
|
|
}
|
|
} |