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

public class HealthDisplay : MonoBehaviour
{
    Text healthText;
    SpaceShipControl spaceShip;

    // Start is called before the first frame update
    void Start()
    {
        healthText = GetComponent<Text>();
        spaceShip = FindObjectOfType<SpaceShipControl>();
    }

    // Update is called once per frame
    void Update()
    {
        healthText.text = spaceShip.GetHealth().ToString();
    }
}
