using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
using TMPro;

public class MenuManager : MonoBehaviour
{
    public GameObject MainPanel;
    public GameObject LevelSelectorPanel;
    public GameObject SettingsPanel;

    [SerializeField] AudioSource OnClickButtonClip;
    [SerializeField] AudioSource OnHoverButtonClip;

    #region Panel Activation
    public void ActivatePanel(string panelToBeActivated)
    {
        MainPanel.SetActive(panelToBeActivated.Equals(MainPanel.name));
        LevelSelectorPanel.SetActive(panelToBeActivated.Equals(LevelSelectorPanel.name));
        SettingsPanel.SetActive(panelToBeActivated.Equals(SettingsPanel.name));
    }

    #endregion 
    
    public void OnClickButtonSound()
    {
        OnClickButtonClip.Play();
    }

    public void OnHoverButtonSound()
    {
        OnHoverButtonClip.Play();
    }

    public void quitGame()
    {
        Application.Quit();
    }

    public void DeletePrefs()
    {
        PlayerPrefs.DeleteAll();
    }

    public void OnStartButton()
    {
        SceneManager.LoadScene(PlayerPrefs.GetInt("LastLevelUnlocked", 1));
    }

    public void LoadLevel(int level)
    {
        SceneManager.LoadScene(level);
    }


}
