Code Monkey home page Code Monkey logo

Comments (9)

Demigiant avatar Demigiant commented on August 20, 2024

Hi!

Woah weird! Ease is calculated in a completely independent way from the duration, so it shouldn't matter at all with callbacks. Could you try with this last version I uploaded (which fixes a bug with callbacks) and let me know if it still happens?

Cheers!

from dotween.

alryazanov avatar alryazanov commented on August 20, 2024

Hi!

You did not try to reproduce the example?

I updated version, but callback still called twice.

Repro project:
http://s000.tinyupload.com/?file_id=71881774889752584613

Thanks!

from dotween.

Demigiant avatar Demigiant commented on August 20, 2024

Ouch, I apologize! I was slammed after completing the new DOTween update yesterday, and I went over your issue too quickly.

Exclusively in the case of Sequences, ease does influence the time position and thus the internal callbacks too. This is not a bug though, because with Bounce (or Elastic) eases some Sequenced tween might actually complete twice. That's because, when the whole Sequence is bouncing, a nested tween might complete, then rewind back a little, then complete again (depending on the position where it was inserted).

from dotween.

alryazanov avatar alryazanov commented on August 20, 2024

I understand what you mean, but in practice it is strange and not intuitive. In practice, user does not expect it and waiting for a single OnComplete callback.

from dotween.

Demigiant avatar Demigiant commented on August 20, 2024

I'm thinking that I might disallow Bounce/Elastic ease with Sequences, which would prevent this confusion, but I would rather not. Uhmmm. By the way, you know you can apply easings to nested Tweens directly (in which case this issue wouldn't happen) right?

from dotween.

alryazanov avatar alryazanov commented on August 20, 2024

Now I am planning to move away from the use of sequences (I will use separate tweens with delays and durations), because the profiler shows certain amount of GC Alloc for sequences (with no callbacks).
Besides, I still think how get around closures (generates lot of GC Alloc for my custom data). For example 100 callback for start, 100 for complete with custom data as args. Maybe using of separate custom timers or timeline for triggers.

from dotween.

Demigiant avatar Demigiant commented on August 20, 2024

Ouch, Sequences generating GC Alloc is very shameful. Totally my bad, I introduced that recently while working around an issue concerning floating point imprecision. I am on it, and hope to remove those allocations asap.

I've thought about possible solutions in order to get around your closure problem, but can't find anything satisfying API-wise and KB-wise. Will ponder more, and if you think of something let me know.

from dotween.

Demigiant avatar Demigiant commented on August 20, 2024

P.S. opened a new issue about Sequences GC alloc here

from dotween.

Demigiant avatar Demigiant commented on August 20, 2024

UPDATE: this is an open issue just so people can read about it, but it's actually a NON issue. It's a matter of how the logic of easing applies to whole Sequences. Here's a summary:

Exclusively in the case of Sequences, ease does influence the time position and thus the internal callbacks too. This is not a bug though, because with Bounce (or Elastic) eases some Sequenced tween might actually complete twice. That's because, when the whole Sequence is bouncing, a nested tween might complete, then rewind back a little, then complete again (depending on the position where it was inserted).

from dotween.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.