using UnityEngine.SceneManagement;
using UnityEngine;

public class PDAMenuManager : MonoBehaviour
{
    public GameObject MainMenu;
    private GameObject CurrentMenu;

    private bool isRunning;

    public void Start()
    {
        CurrentMenu = MainMenu;
        ShowMenu(CurrentMenu);
        isRunning = false;

    }

    public void ShowMenu(GameObject menu)
    {
        if (CurrentMenu != null)
        {
            CurrentMenu.SetActive(false);
        }
        CurrentMenu = menu;
        CurrentMenu.SetActive(true);
    }

    public void TurnOff()
    {
        if (CurrentMenu != null)
        {
            CurrentMenu.SetActive(false);
        }
        isRunning = false;
    }

    public void TurnOn()
    {
        if (!isRunning)
        {
            ShowMenu(MainMenu);
        }
        isRunning = true;
    }

    public void Resume()
    {
        Debug.Log("Resuming game through PDA..");
        TurnOff();
        //TO DO: resume game
    }

    public void Quit()
    {
        Debug.Log("Quitting application through PDA..");
        SceneManager.LoadScene("menu");
    }

}
