1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-14 07:22:54 +08:00

Use Lerp instead of ValueAt

This commit is contained in:
Dean Herbert 2020-04-09 14:51:50 +09:00
parent c44957db3f
commit 5a78e74470

View File

@ -89,8 +89,9 @@ namespace osu.Game.Screens.Play.HUD
protected override void Update() protected override void Update()
{ {
boxes.Alpha = (float)Interpolation.ValueAt(Math.Clamp(Clock.ElapsedFrameTime, 0, fade_time), boxes.Alpha, double target = Math.Clamp(max_alpha * (1 - Current.Value / LowHealthThreshold), 0, max_alpha);
Math.Clamp(max_alpha * (1 - Current.Value / LowHealthThreshold), 0, max_alpha), 0, fade_time, Easing.Out);
boxes.Alpha = (float)Interpolation.Lerp(boxes.Alpha, target, Clock.ElapsedFrameTime * 0.01f);
base.Update(); base.Update();
} }