mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 14:46:38 +09:00
Use switch instead of if-else.
This commit is contained in:
@ -315,20 +315,21 @@ namespace osu.Game.Overlays
|
||||
|
||||
Add(newBackground);
|
||||
|
||||
if (direction == TransformDirection.Next)
|
||||
switch (direction)
|
||||
{
|
||||
newBackground.Position = new Vector2(400, 0);
|
||||
newBackground.MoveToX(0, 500, EasingTypes.OutCubic);
|
||||
backgroundSprite.MoveToX(-400, 500, EasingTypes.OutCubic);
|
||||
case TransformDirection.Next:
|
||||
newBackground.Position = new Vector2(400, 0);
|
||||
newBackground.MoveToX(0, 500, EasingTypes.OutCubic);
|
||||
backgroundSprite.MoveToX(-400, 500, EasingTypes.OutCubic);
|
||||
break;
|
||||
case TransformDirection.Prev:
|
||||
newBackground.Position = new Vector2(-400, 0);
|
||||
newBackground.MoveToX(0, 500, EasingTypes.OutCubic);
|
||||
backgroundSprite.MoveToX(400, 500, EasingTypes.OutCubic);
|
||||
break;
|
||||
}
|
||||
else if (direction == TransformDirection.Prev)
|
||||
{
|
||||
newBackground.Position = new Vector2(-400, 0);
|
||||
newBackground.MoveToX(0, 500, EasingTypes.OutCubic);
|
||||
backgroundSprite.MoveToX(400, 500, EasingTypes.OutCubic);
|
||||
}
|
||||
backgroundSprite.Expire();
|
||||
|
||||
backgroundSprite.Expire();
|
||||
backgroundSprite = newBackground;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user