TimeScale all Tweens #127
-
Hi |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Hey! PrimeTween doesn't have this feature yet. It would be very easy to add it, but I would like to first understand the potential use case. |
Beta Was this translation helpful? Give feedback.
-
I have been thinking about adding a new Instead, I updated the implementation of the To apply it to your use case, add all animation that you wish to speed up to the TweenGroup, then you can set the timeScale immediately or animate it for the whole group. What do you think? readonly TweenGroup group = new TweenGroup();
public void Test() {
// Add animations to the group:
group.Add(Tween.PositionX(transform, 10f, duration: 1f));
group.Add(
Sequence.Create()
.ChainDelay(1f)
.Chain(Tween.Rotation(transform, new Vector3(0f, 90f), duration: 1f))
);
// Set group timeScale immediately:
group.timeScale = 0.5f;
// Animate group timeScale:
group.AnimateTimeScale(endValue: 0.5f, duration: 1f);
// Stop or complete the group:
group.Stop();
group.Complete();
} |
Beta Was this translation helpful? Give feedback.
@peyman1959
I have been thinking about adding a new
PrimeTweenConfig.timeScale
property and found a few potential limitations. If a user wants to speed up only a few selected animations but leave others unchanged, thePrimeTweenConfig.timeScale
will still not be enough. And I imagine that would be quite a common situation. So it seems to me that addingPrimeTweenConfig.timeScale
would be limiting.Instead, I updated the implementation of the
TweenGroup
to also providetimeScale
property andTweenTimeScale()
method: #26 (reply in t…