Skip to content

Disable warnEndValueEqualsCurrent on a per tween/sequence basis #48

Answered by KyryloKuzyk
Nelvin asked this question in General
Discussion options

You must be logged in to vote

Hey,

Unfortunately, enabling the warnEndValueEqualsCurrent setting is impossible on a per-tween basis. I understand that checking the current value is not a perfect solution, but I'm afraid this is the only option for now:

public Sequence Animate() {
    var sequence = Sequence.Create();
    if (image.color.a != targetAlpha) {
        sequence.Group(Tween.Alpha(image, targetAlpha, duration));
    }
    return sequence;
}

Yes, disabling the warnEndValueEqualsCurrent settings just before creating a tween and enabling the setting right after that will not work because PrimeTween doesn't start animation immediately, but waits for LateUpdate() (or for the startDelay as in your case).

One thing…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by KyryloKuzyk
Comment options

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

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