Skip to content

Is there a way to add our own Tweens (as part of original library) #122

Discussion options

You must be logged in to vote

Hey Anthony,

There is no simple way to add a built-in animation. You can, of course, embed the library by copying its source code to the Packages folder, but that's not a good long-term solution.

The reason why this animation can't be built-in is because it would break PrimeTween's zero-allocation design. Your example allocates garbage because the delegate captures formattedString and arg1 arguments into a closure. Here is an example of a possible solution:

[SerializeField] Image SampleFillImage;
[SerializeField] TextAnimationData textAnimationData;
[SerializeField] TweenSettings TweenSettings;

public Sequence Animate() {
    return Sequence.Create()
        .Group(Tween.UIFillAmount(Sam…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@AnthonyDemanueleFSG
Comment options

Answer selected by KyryloKuzyk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants