Merge branch 'Tryibion-prog-bar-lerp-jump'

This commit is contained in:
Wojtek Figat
2024-08-21 22:59:12 +02:00

View File

@@ -143,9 +143,11 @@ namespace FlaxEngine.GUI
if (!Mathf.NearEqual(value, _value))
{
_value = value;
if (!UseSmoothing)
if (!UseSmoothing || _firstUpdate)
{
_current = _value;
if (_firstUpdate)
_firstUpdate = false;
}
}
}
@@ -169,6 +171,9 @@ namespace FlaxEngine.GUI
[EditorDisplay("Bar Style"), EditorOrder(2012), Tooltip("The brush used for progress bar drawing.")]
public IBrush BarBrush { get; set; }
// Used to remove initial lerp from the value on play.
private bool _firstUpdate = true;
/// <summary>
/// Initializes a new instance of the <see cref="ProgressBar"/> class.
/// </summary>