Change test to move only on a toggle step

This commit is contained in:
Dean Herbert 2023-11-08 17:23:01 +09:00
parent 6c6baab115
commit 38847c3ac5
No known key found for this signature in database
1 changed files with 9 additions and 8 deletions

View File

@ -13,10 +13,10 @@ namespace osu.Game.Tests.Visual.Online
[TestFixture]
public partial class TestSceneGraph : OsuTestScene
{
private readonly BarGraph graph;
public TestSceneGraph()
{
BarGraph graph;
Child = graph = new BarGraph
{
RelativeSizeAxes = Axes.Both,
@ -34,13 +34,14 @@ public TestSceneGraph()
AddStep("Top to bottom", () => graph.Direction = BarDirection.TopToBottom);
AddStep("Left to right", () => graph.Direction = BarDirection.LeftToRight);
AddStep("Right to left", () => graph.Direction = BarDirection.RightToLeft);
}
protected override void LoadComplete()
{
base.LoadComplete();
graph.MoveToY(-10, 1000).Then().MoveToY(10, 1000).Loop();
AddToggleStep("Toggle movement", enabled =>
{
if (enabled)
graph.MoveToY(-10, 1000).Then().MoveToY(10, 1000).Loop();
else
graph.ClearTransforms();
});
}
}
}