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

public class FreezeScreen : MonoBehaviour {

    Image image;

    GlobalManager manager;

    bool previousFrozen;

    public Color flashColor;

    public Color blueColor;

    // Use this for initialization
    void Start () {
        manager = GameObject.FindGameObjectWithTag("GameController").GetComponent<GlobalManager>();
        image = GetComponent<Image>();
    }
	
	// Update is called once per frame
	void Update () {
        if (manager.frozen)
        {
            image.enabled = true;
            if (!previousFrozen)
                image.color = flashColor;
            else
                image.color = blueColor;
        }
        else
            image.enabled = false;

        previousFrozen = manager.frozen;
	}
}
