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

Can an overload of 'MotionSequenceBuilder.Run' that accepts a state be added? #192

Open
c3-hoge-fuga-piyo opened this issue Jan 6, 2025 · 1 comment

Comments

@c3-hoge-fuga-piyo
Copy link
Contributor

c3-hoge-fuga-piyo commented Jan 6, 2025

I would like to use it in the following way:

MotionHandle Example(float delay, bool loop, bool ignoreTimeScale)
{
    var s = LSequence.Create();
    {
        /* Append|Join various MotionHandles... */
    }
    return s.Run((delay, loop, ignoreTimeScale), static (builder, state) => builder
        .WithDelay(state.delay)
        .WithLoop(state.loop ? -1 : 1)
        .WithScheduler(state.ignoreTimeScale ? MotionScheduler.UpdateIgnoreTimeScale : MotionScheduler.Update));
}
@c3-hoge-fuga-piyo
Copy link
Contributor Author

https://github.com/AnnulusGames/LitMotion/blob/f7df4966aa30482fb739148aba2bc7bc672dfaf6/src/LitMotion/Assets/LitMotion/Runtime/MotionSequenceBuilder.cs#L73C9-L86

I think it might be possible by adding an overload of MotionSequenceBuilderSource.Schedule that accepts state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant