public void Initialize(ResourceBarValue ResourceBarValue) { //Debug.Log($"{ResourceBarValue} is now being tracked"); _resourceValue = ResourceBarValue; MyMaxValue = _resourceValue.MaxValue; MyCurrentValue = _resourceValue.CurrentValue; valueText = GetComponentInChildren <TMP_Text>(); //eliminates a race condition valueText.text = $"{MyCurrentValue}/{MyMaxValue}"; }
public void Initialize(ResourceBarValue ResourceBarValue) { _resourceValue = ResourceBarValue; MyMaxValue = _resourceValue.MaxValue; MyCurrentValue = _resourceValue.CurrentValue; }