using UnityEngine;
using UnityEngine.UI;

public class UIInGameMenu : MonoBehaviour, IMenuState
{
    [SerializeField] private Button mainMenu;
    [SerializeField] private Button exit;
    [SerializeField] private AudioClipGroup clickSound;

    private void Start()
    {
        mainMenu.onClick.AddListener(MenuManager.Instance.RestartScene);
        exit.onClick.AddListener(MenuManager.Instance.ExitGame);
        gameObject.SetActive(false);
    }

    public void Enter() { }

    public void Exit()
    {
        gameObject.SetActive(false);
    }

    public void UpdateMenu()
    {
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            clickSound.Play();
            gameObject.SetActive(!gameObject.activeSelf);
        }
    }
}
