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

public class UIManager : MonoBehaviour
{
    public static UIManager instance;

    public GameObject txtQuote;
    public GameObject winQuote;
    public GameObject restartButton;

    private void Awake()
    {
        instance = this;
    }

    private void Start()
    {
        txtQuote.SetActive(false);
        restartButton.SetActive(false);
        winQuote.SetActive(false);
    }

    public void GameOver()
    {
        txtQuote.SetActive(true);
        restartButton.SetActive(true);

        restartButton.GetComponent<Button>().onClick.AddListener(() =>
       {
           PlayAgain();
       });
    }

    public void Win()
    {
        winQuote.SetActive(true);
        restartButton.SetActive(true);

        restartButton.GetComponent<Button>().onClick.AddListener(() =>
        {
            PlayAgain();
        });
    }

    public void PlayAgain()
    {
        SceneManager.LoadScene(SceneManager.GetActiveScene().name);
    }

}
