mirror of
https://github.com/ppy/osu
synced 2025-01-11 16:49:39 +00:00
Reorder easing mapping to match enum order and throw on unknown animation style
This commit is contained in:
parent
aba9ed624a
commit
5001412a0d
@ -52,24 +52,27 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
{
|
{
|
||||||
switch (style)
|
switch (style)
|
||||||
{
|
{
|
||||||
default:
|
case AnimationStyle.Linear:
|
||||||
return Easing.None;
|
return Easing.None;
|
||||||
|
|
||||||
|
case AnimationStyle.Gravity:
|
||||||
|
return Easing.InBack;
|
||||||
|
|
||||||
|
case AnimationStyle.InOut1:
|
||||||
|
return Easing.InOutCubic;
|
||||||
|
|
||||||
|
case AnimationStyle.InOut2:
|
||||||
|
return Easing.InOutQuint;
|
||||||
|
|
||||||
case AnimationStyle.Accelerate1:
|
case AnimationStyle.Accelerate1:
|
||||||
return Easing.In;
|
return Easing.In;
|
||||||
|
|
||||||
case AnimationStyle.Linear:
|
|
||||||
return Easing.None;
|
|
||||||
|
|
||||||
case AnimationStyle.Accelerate2:
|
case AnimationStyle.Accelerate2:
|
||||||
return Easing.InCubic;
|
return Easing.InCubic;
|
||||||
|
|
||||||
case AnimationStyle.Accelerate3:
|
case AnimationStyle.Accelerate3:
|
||||||
return Easing.InQuint;
|
return Easing.InQuint;
|
||||||
|
|
||||||
case AnimationStyle.Gravity:
|
|
||||||
return Easing.InBack;
|
|
||||||
|
|
||||||
case AnimationStyle.Decelerate1:
|
case AnimationStyle.Decelerate1:
|
||||||
return Easing.Out;
|
return Easing.Out;
|
||||||
|
|
||||||
@ -79,11 +82,8 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
case AnimationStyle.Decelerate3:
|
case AnimationStyle.Decelerate3:
|
||||||
return Easing.OutQuint;
|
return Easing.OutQuint;
|
||||||
|
|
||||||
case AnimationStyle.InOut1:
|
default:
|
||||||
return Easing.InOutCubic;
|
throw new ArgumentOutOfRangeException(nameof(style), style, @"Unsupported animation style");
|
||||||
|
|
||||||
case AnimationStyle.InOut2:
|
|
||||||
return Easing.InOutQuint;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user