Newer
Older
HardPoint-Project-Abertay-University-Unity3D / Assets / EntityUiController.cs
@Rackday Rackday on 18 Aug 549 bytes Project Added
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class EntityUiController : MonoBehaviour
{
    [SerializeField] private Image healthBar;
    StatusEffects statusEffects;
    HealthSystem healthSystem;
    void Start()
    {
        statusEffects = GetComponent<StatusEffects>();
        healthSystem = GetComponent<HealthSystem>();
    }

    // Update is called once per frame
    public void EditHealth()
    {
        healthBar.fillAmount = healthSystem.GetHealthPercentage();
    }
}