2D Health Bar Value not Updating

Currently I am creating a Health Bar for my player and am updating the value in another class. The value being returned that is incorrect is the _fillAmount variable who is inheriting from the BarValue property. Using Debug statements I have identified that the _fillAmount value is being updated correctly in the BarValue property but when the Update function calls HandleBar() it is not receiving the updated _fillAmount value, stating it is still the originial value of 1. Below is my code, any suggestions?

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

public class ui_bar : MonoBehaviour {

    private float _fillAmount = 1;

    private Image _content;

    public float MaxValue {
        get;
        set;
    }

    public float BarValue {
        set {
            _fillAmount = H_Calc (value, 0, MaxValue, 0, 1);
            Debug.Log ("Updated Fill Amount Value to " + _fillAmount + ".");
        }
    }
   
    // Update is called once per frame
    void Update (){
        HandleBar ();
    }

    private void HandleBar(){
        Debug.Log ("Fill Amount Value " + _fillAmount + ".");
        if (_fillAmount != _content.fillAmount) {
            _content.fillAmount = _fillAmount;
            Debug.Log ("Fill is now " + _fillAmount + ".");
        }
    }

    private float H_Calc(float _value, float _inMin, float _inMax, float _outMin, float _outMax){
        return (_value - _inMin) * (_outMax - _outMin) / (_inMax - _inMin) + _outMin;
    }
}

At what point does BarValue get assigned, so that “_fillAmount” gets updated?

Generally when you use a public property with a private backing field, the public property will be the only thing that references the private field. Everywhere else in the code, you will reference the public property only to keep one point of access for the private field.

So give your BarValue a “get” block, returning “_fillAmount”, and then replace all your _fillAmount references with a BarValue reference instead (except the reference inside BarValue).

You then actually have to set BarValue = something to get your calculation function to run.