[Proposal] Sequence support #93
Replies: 8 comments 12 replies
-
My initial opinion when implementing LitMotion was that asynchronous processing should be left to async/await and Rx, and that tweens should not have functions like sequences. However, when creating a composite animation, I ran into a problem where it was difficult to perform operations such as complete all at once using The |
Beta Was this translation helpful? Give feedback.
-
Also, this feature will not be included in the regular package, but will be distributed as a separate package (LitMotion.Sequences). Therefore, you can install it as needed. |
Beta Was this translation helpful? Give feedback.
-
MotionSequence.CurrentHandle will be useful to change PlayBackSpeed. |
Beta Was this translation helpful? Give feedback.
-
Can I add delay between Appends - ? |
Beta Was this translation helpful? Give feedback.
-
Although allocations occur, they could be reproduced in an easy to write coroutine-like form. IEnumerable<SeqYieldPoint> SequenceFunc(SeqCoroutine s)
{
yield return s.Wait(LMotion.Create(0f, 180f, 1f).BindToEulerAnglesZ(target1));
yield return s.Wait(LMotion.Create(0f, 180f, 1f).BindToEulerAnglesZ(target2));
yield return s.Wait(LMotion.Create(0f, 180f, 1f).BindToEulerAnglesZ(target3));
Debug.Log(s.IsPlaying() ? "Is Playing" : "Force Complete");
yield return s.Wait(stackalloc MotionHandle[]
{
LMotion.Create(-2f, 2f, 1f).WithLoops(3, LoopType.Yoyo).BindToPositionY(target1),
LMotion.Create(-2f, 2f, 1f).WithLoops(2, LoopType.Yoyo).BindToPositionY(target2),
LMotion.Create(-2f, 2f, 1f).BindToPositionY(target3)
});
}
sequence = new SeqCoroutine(SequenceFunc); |
Beta Was this translation helpful? Give feedback.
-
Hi, After trying LitMotion and I came here from the unity forum thread If there's a simple way I missed, please enlighten me. |
Beta Was this translation helpful? Give feedback.
-
We added new Sequence features in #158, so this discussion is closed. |
Beta Was this translation helpful? Give feedback.
-
I'm currently considering adding the Sequence feature to LitMotion, and would like to get your opinions on it.
The current API proposal is as follows.SequencePlayMode
can be specified asSequential
orParallel
, andSequential
uses async/await usingValueTask
internally.I made a few changes from the first draft.
SequencePlayMode
is removed and all sequences are executed sequentially. However, you can also useAppendGroup()
to add groups of motions to run in parallel.Beta Was this translation helpful? Give feedback.
All reactions