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

[RequireComponent(typeof(Image))]
public class EnergyBar : MonoBehaviour
{
    private Image _imageComponent;

    private void Awake()
    {
        _imageComponent = GetComponent<Image>();
    }

    public void Update()
    {
        _imageComponent.fillAmount = FirstPersonController.Instance.CurrentEnergy / FirstPersonController.Instance.MaxEnergy;
    }
}
