/// <summary> /// Updates the bar's values based on the specified parameters /// </summary> /// <param name="currentValue">Current value.</param> /// <param name="minValue">Minimum value.</param> /// <param name="maxValue">Max value.</param> public virtual void UpdateBar(float currentValue, float minValue, float maxValue) { _newPercent = HappyMath.Remap(currentValue, minValue, maxValue, startValue, endValue); BarProgress = _newPercent; TargetFillAmount = _newPercent; _lastUpdateTimestamp = Time.time; }
protected virtual void AutoUpdate() { if (!AutoUpdating) { return; } _newPercent = HappyMath.Remap(BarProgress, 0f, 1f, startValue, endValue); TargetFillAmount = _newPercent; //_lastUpdateTimestamp = Time.time; }