Convert to method

This commit is contained in:
David Zhao
2019-07-05 13:10:59 +09:00
parent 9eeafa0861
commit 4eb01b12be

View File

@ -54,14 +54,7 @@ namespace osu.Game.Tests.Visual.UserInterface
foreach (var s in Enum.GetValues(typeof(ButtonSystemState)).OfType<ButtonSystemState>().Skip(1)) foreach (var s in Enum.GetValues(typeof(ButtonSystemState)).OfType<ButtonSystemState>().Skip(1))
AddStep($"State to {s}", () => buttons.State = s); AddStep($"State to {s}", () => buttons.State = s);
AddStep("Enter mode", () => AddStep("Enter mode", performEnterMode);
{
buttons.State = ButtonSystemState.EnteringMode;
buttons.FadeOut(MainMenu.FADE_OUT_DURATION, Easing.InSine);
buttons.MoveTo(new Vector2(-800, 0), MainMenu.FADE_OUT_DURATION, Easing.InSine);
logo.FadeOut(300, Easing.InSine)
.ScaleTo(0.2f, 300, Easing.InSine);
});
AddStep("Return to menu", () => AddStep("Return to menu", () =>
{ {
@ -76,14 +69,16 @@ namespace osu.Game.Tests.Visual.UserInterface
[Test] [Test]
public void TestSmoothExit() public void TestSmoothExit()
{ {
AddStep("Enter mode", () => AddStep("Enter mode", performEnterMode);
{ }
buttons.State = ButtonSystemState.EnteringMode;
buttons.FadeOut(400, Easing.InSine); private void performEnterMode()
buttons.MoveTo(new Vector2(-800, 0), 400, Easing.InSine); {
logo.FadeOut(300, Easing.InSine) buttons.State = ButtonSystemState.EnteringMode;
.ScaleTo(0.2f, 300, Easing.InSine); buttons.FadeOut(MainMenu.FADE_OUT_DURATION, Easing.InSine);
}); buttons.MoveTo(new Vector2(-800, 0), MainMenu.FADE_OUT_DURATION, Easing.InSine);
logo.FadeOut(300, Easing.InSine)
.ScaleTo(0.2f, 300, Easing.InSine);
} }
} }
} }