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

public class OnAirHandler : MonoBehaviour {

    public Radio radio;

    public Sprite onAir;
    public Sprite offAir;

    Image imagem;

	// Use this for initialization
	void Start () {
        imagem = GetComponentInChildren<Image>();
	}
	
	// Update is called once per frame
	void Update () {
        if (radio.tocando && !imagem.sprite.name.Equals(onAir.name)) {
            imagem.sprite = onAir;
        } else if (!radio.tocando && !imagem.sprite.name.Equals(offAir.name)) {
            imagem.sprite = offAir;
        }
	}
}
