using TMPro;
using UnityEngine;
using UnityEngine.SceneManagement;

public class GameManager : MonoBehaviour
{
    public static GameManager Instance;

    public GameObject resultPanel;
    public TextMeshProUGUI resultText;

    private void Awake()
    {
        Instance = this;
    }

    public void ShowWinner(string loserName)
    {
        resultPanel.SetActive(true);

        if (loserName.Contains("Blue"))
            resultText.text = "RED WIN!";
        else
            resultText.text = "BLUE WIN!";

        Time.timeScale = 0f;
    }

    public void Again()
    {
        SceneManager.LoadScene(SceneManager.GetActiveScene().name);
        Time.timeScale = 1f;
    }

}