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

public class GameManager : MonoBehaviour
{

    public static GameManager instance;

    public bool inProgress;

    public Text text;


    private void Awake()
    {
        instance = this;
    }

    // Start is called before the first frame update
    void Start()
    {
        inProgress = true;

        //text.enabled = false;
    }

    // Update is called once per frame
    void Update()
    {

        Pause();
        if (Input.GetKeyDown(KeyCode.R))
        {
            SceneManager.LoadScene("MainSceneGGJ");
        }
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            Debug.Log("Loser, formatta il sistema.");
            Application.Quit();
        }
    }

    void Pause()
    {
        if (Input.GetKeyDown(KeyCode.P))
        {
            inProgress = !inProgress;

            //text.enabled = !text.enabled;

            Time.timeScale = Time.timeScale == 0 ? 1 : 0;
        }
    }
}
