-
Notifications
You must be signed in to change notification settings - Fork 141
Description
Hi @dentedpixel 👋
First of all, I really like your LeanTween project and appreciate your hard work and what you've achieved!! 😀
I noticed some unexpected LeanTween behavior in one of my other projects and tried to reproduce it in a separate project.
You can also find the code in the repo, to run it yourself if you want.
Setup
- 3 rows of objects, each row is an instance of a prefab
- a row consists of:
- an UI Image, whose alpha value is changed by LeanTween using
LeanTween.alpha(image.rectTransform, 0.3f, 0.5f).setLoopPingPong() - an ON button, which triggers the effect
LeanTween.resume(tweenId) - an OFF button, which pauses the effect
LeanTween.pause(tweenId) - a text field, which shows the current
isPausedvalueLeanTween.isPaused(tweenId) - a text field, which shows the current
isTweeningvalueLeanTween.isTweening(tweenId) - each row has its own unique tweenId (shown above the image), derived from
tweenId = LeanTween.alpha(image.rectTransform, 0.3f, 0.5f).setLoopPingPong().id
- an UI Image, whose alpha value is changed by LeanTween using
Current Behavior
-
isTweeningis ALWAYS true, even when the tween is paused (is this expected behavior?)- I expected that
isTweeningis the opposite/negation ofisPaused - The docu says:
Test whether or not a tween is active on a GameObject
And I thought when a tween is paused it's not active, so it would be false.
- I expected that
-
when the first row is resumed or paused, then it also changes the value of all the other rows (even though they have different ids, so
LeanTween.isPaused(tweenId)should be unique for the first row and shouldn't affect the other rows -
when the other rows are resumed or paused, then it does not change the result of the
isPausedmethod -
I checked the LeanTween isPaused() implementation and noticed that
isPausedreturns the result ofisTweening, is this intended? btw I found an already existing issue regarding that isPaused copy-paste error #160
public static bool isPaused(RectTransform rect)
{
return isTweening(rect.gameObject);
}
Expected Behavior
- Pausing a tween should not affect the result of
isPausedfor other tweens with different ids. isTweeningreturns true, while it's tweening (when active) or false when not (e.g. when paused). But perhaps that's a wrong expectation or understanding on my side.
