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

public class Corazon : MonoBehaviour
{
    Image image1;
    Osito Cora;
    public int Vida;
    public Text VidaT;
    // Start is called before the first frame update
    void Start()
    {
        
        Cora = GameObject.Find("Osito").GetComponent<Osito>();
        Vida = Cora.Vidas;
        VidaT.text = Vida.ToString();
    }

    // Update is called once per frame
    void Update()
    {
        Vida = Cora.Vidas;
        VidaT.text = Vida.ToString();
        image1 = GetComponent<Image>();
        Color A = image1.color;
        A.a = 1f;
        image1.color = A;

        if (Cora.Vidas == 2)
        {
            image1 = GetComponent<Image>();
            A.a = 0.75f;
            image1.color = A;
        }
        if (Cora.Vidas == 1)
        {
            image1 = GetComponent<Image>();
            A.a = 0.25f;
            image1.color = A;
        }

    }
}
