19 lines
533 B
C#
19 lines
533 B
C#
using System;
|
|
using UnityEngine;
|
|
using NEG.UI.Window;
|
|
using NEG.UI.WindowSlot;
|
|
|
|
namespace NEG.UI.UnityUi.Buttons
|
|
{
|
|
[RequireComponent(typeof(BaseButton))]
|
|
public class OpenWindow : MonoBehaviour
|
|
{
|
|
[SerializeField] private MonoWindow window;
|
|
[Header("Open on default area slot if empty")]
|
|
[SerializeField] private MonoWindowSlot slot;
|
|
|
|
private void Awake() => GetComponent<BaseButton>().OnButtonPressed += OnClicked;
|
|
|
|
private void OnClicked() => window.Open(slot);
|
|
}
|
|
} |