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

public class ChangeColor : MonoBehaviour {

	Color tmp;

	Reactor reactor;

	// Use this for initialization
	void Start () {

		reactor = FindObjectOfType<Reactor>();

		tmp = this.GetComponent<Image> ().color;

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

		if (reactor.temperature > reactor.dangerousTemperature)
		{
			tmp.a = reactor.temperature;
		
		}
	
		this.GetComponent<Image> ().color = tmp;
	}
}
