Replies: 2 comments 1 reply
-
|
Another workaround I found is this - it's not that clean though, since it looks like I create one Sequence too much: public static Sequence GroupWithDelay(this Sequence mainSequence, float delay, Sequence sequence)
{
if (delay <= 0f)
{
return mainSequence.Group(sequence);
}
Sequence delayedSequence = Sequence.Create();
delayedSequence.ChainDelay(delay);
delayedSequence.Chain(sequence);
return mainSequence.Group(delayedSequence);
}Another similar helper I found useful (not related to my issue though): /// <summary>
/// Chains a sequence with an overlap time (i.e. "negative delay").
/// This is useful if you want to chain a sequence, but you want the chained sequence to start before the previous one ends.
/// </summary>
public static Sequence ChainWithOverlap(this Sequence mainSequence, float overlap, Sequence sequence)
{
if (overlap <= 0f)
{
return mainSequence.Chain(sequence);
}
return mainSequence.Insert(mainSequence.duration - overlap, sequence);
} |
Beta Was this translation helpful? Give feedback.
-
|
Hey @flo-wolf, it's fine to create many empty sequences with PrimeTween, and it should not hurt performance :) So, your proposal is to add a new
But for me, it looks very similar to what the private void CreateBigSequence()
{
Sequence bigSequence = Sequence.Create();
bigSequence.Chain(_firstSequence);
bigSequence.Group(_secondSequence);
bigSequence.Insert(atTime: 0.1f, GetMyThirdSequence());
// To continue grouping, insert the next sequence at 0f:
bigSequence.Insert(atTime: 0f, _forthSequence);
bigSequence.Group(_fifthSequence);
}Or you can add all the grouped sequences first, then insert sequences that should be delayed. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey :)
I am often "composing" multiple sequences into each other, where I have one big sequence into which I chain/group lots of other sequences. I often get to the point where I want to start two sequences at once (i.e. group), but one of them should start with some delay. I could do this with an insert, but for that i'd need the current duration of the sequence and computing this delay through adding up the durations of all other chained sequences seems combersome and not maintainable.
My current solution is to chain a delay to the start of the sequence I want to group. It doesn't feel very clean though and is not that easy to work with:
Doing that with inserts instead is even more complicated, since I can't switch _secondSequence and the third sequence, because then _secondSequence couldn't be grouped with first anymore (also it's odd to read, since practically the second sequence starts before the third).
What would be cool:
Beta Was this translation helpful? Give feedback.
All reactions