2024-03-03 15:38:40 +01:00

21 lines
532 B
C#

using NEG.UI.UnityUi.Window;
using NEG.UI.Window;
using UnityEngine;
namespace NEG.UI.UnityUi.Buttons.Reactions
{
[RequireComponent(typeof(BaseButton))]
public class CloseWindow : ButtonReaction
{
[SerializeField] private MonoWindow windowToClose;
private void OnValidate()
{
if (windowToClose != null)
return;
windowToClose = GetComponentInParent<MonoWindow>();
}
protected override void OnClicked() => windowToClose.Close();
}
}