Newer
Older
TheVengeance-Project-IADE-Unity2D / Assets / Scripts / NPC / HealthBar.cs
@Rackday Rackday on 3 Sep 720 bytes Minor Update
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class HealthBar : MonoBehaviour
{
    [SerializeField] private Image image;
    [SerializeField] private GameObject obj;
    private IHealthSystem healthSystem;

    private void Awake()
    {
        if (!obj.TryGetComponent(out healthSystem))
        {
            Debug.LogError($"Missing {nameof(IHealthSystem)} component");
        }
    }

    // Start is called before the first frame update
    void Start()
    {
            
    }

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

    public void UpdateHealth()
    {
        image.fillAmount = 0f;
    }
}