using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;

public class UIKeyBinder : MonoBehaviour
{
    [SerializeField] private GameObject UI;
    [SerializeField] private GameKey key;

    public UnityEvent<bool> OnUIVisibilityChanged = new UnityEvent<bool>();

    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(key.keyCode))
        {
            UI.SetActive(!UI.activeSelf);
            OnUIVisibilityChanged.Invoke(UI.activeSelf);
        }
    }
}
