Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected pause & resume behavior #167

Open
Thommynator opened this issue Sep 12, 2021 · 2 comments
Open

Unexpected pause & resume behavior #167

Thommynator opened this issue Sep 12, 2021 · 2 comments

Comments

@Thommynator
Copy link

Thommynator commented Sep 12, 2021

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 isPaused value LeanTween.isPaused(tweenId)
    • a text field, which shows the current isTweening value LeanTween.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

Current Behavior

  • isTweening is ALWAYS true, even when the tween is paused (is this expected behavior?)

    • I expected that isTweening is the opposite/negation of isPaused
    • 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.

  • 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 isPaused method

  • I checked the LeanTween isPaused() implementation and noticed that isPaused returns the result of isTweening, 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 isPaused for other tweens with different ids.
  • isTweening returns 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.
@basisbit
Copy link

Sorry, but this project is dead since end of 2018. The develop does not have any activity online at all any more.

@Thommynator
Copy link
Author

Hi @basisbit
Thanks for your response. That's very unfortunate. 😕
I noticed as well that @dentedpixel isn't active on this project anymore, but I had the hope that there might be another contributor in this project who might have taken this project over. 🤷‍♂️
Anyway... Have a great day.

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

No branches or pull requests

2 participants