using NEG.UI.Area; using System; using UnityEngine; namespace NEG.UI.Popup { public class MonoPopup : MonoBehaviour, IPopup { public event Action OnPopupClosed; public bool IsValid { get; private set; } public void Close(bool isForced = false) { IsValid = false; gameObject.SetActive(false); if(!isForced) OnPopupClosed?.Invoke(this); } public void SetEnabled(bool setEnabled) => gameObject.SetActive(setEnabled); void IPopup.Show() => IsValid = true; } }