Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TransformSequence.Expire() doesn't work correctly in nested sequences #2941

Open
smoogipoo opened this issue Nov 1, 2019 · 0 comments
Open

Comments

@smoogipoo
Copy link
Contributor

public class TestSceneScratch : FrameworkTestScene
{
    [Test]
    public void TestMethod1() => AddStep("reset", () =>
    {
        var box = new Box { Size = new Vector2(100) };

        Child = box;

        using (box.BeginAbsoluteSequence(Time.Current - 1000))
        {
            box.FadeColour(Color4.Green) // Transform in the past
               .Delay(2000).FadeColour(Color4.White) // Transform a little in the future
               .Delay(10000).Expire(true); // Delay is not important
        }
    });

    [Test]
    public void TestMethod2() => AddStep("reset", () =>
    {
        var box = new Box { Size = new Vector2(100) };

        Child = box;

        using (box.BeginAbsoluteSequence(Time.Current - 1000))
        {
            box.FadeColour(Color4.Green).Expire(true); // Transform in the past

            box.Delay(2000).FadeColour(Color4.White) // Transform a little in the future
               .Delay(10000).Expire(); // Delay is not important
        }
    });
}

Both of the methods above are expected to work exactly the same, however only method 2 provides the expected result. The lifetime of the box is expected to be the full range of green -> white.

It seems like since the past transform is immediately applied (due to endtime < current time), the .Expire(true) call from a nested TransformSequence does not consider it.

@smoogipoo smoogipoo added this to the Candidate Issues milestone Nov 1, 2019
@peppy peppy removed this from the Candidate Issues milestone Mar 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants