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


public class FadeCanvas : MonoBehaviour {

    public static FadeCanvas instance;
    public Animator fadeAnim;
    public Text Fired;
    public GameObject WIN;
    private void Awake ()
    {
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Destroy(this);
        }
    }

    public void setFade (bool setFade)
    {
        if (fadeAnim != null)
        {
            if (fadeAnim.GetBool("FadedIn") != setFade)
            {
                fadeAnim.SetBool("FadedIn", setFade);
                if (!setFade)
                {
                    Fired.enabled = false;
                    WIN.SetActive(false);
                }
            }
        }
    }

    public void showFired ()
    {
        Fired.enabled = true;
    }
    
    public void showWIN ()
    {
        WIN.SetActive(true);
    }
}
