Skip to content
This repository was archived by the owner on Aug 3, 2024. It is now read-only.

Chained tweens are always added to manager #2

Open
RanzQ opened this issue Jul 21, 2016 · 3 comments
Open

Chained tweens are always added to manager #2

RanzQ opened this issue Jul 21, 2016 · 3 comments

Comments

@RanzQ
Copy link
Contributor

RanzQ commented Jul 21, 2016

I was wondering why the tween count in the manager was rising and noticed that when I was chaining non-expiring tweens, they were added to the manager every time on tween end.

https://github.com/Nazariglez/pixi-tween/blob/master/src/Tween.js#L169

So maybe it should be checked here if the tween has a manager already.

@themoonrat
Copy link

Going to start using this lib... is this something I should look out for? Would it be a quick case of adding a check in the addTween function of TweenManager to see if the tween already exists in the array?

@Nazariglez
Copy link
Owner

Hi guys! Sorry I forgot to answer this.

Each tween created is added to the manager as a unique entity, this way allow store differents tweens in vars and contact them later.

Other way will be store a json object with the tween data and use only one instance of tween, chaining this "configs". But I don't see this clear, I think is easiest now.

@themoonrat
Copy link

Finally came up against this issue - so I put a guard around adding to the manager. It now only does so if the tween wasn't already assigned to one - themoonrat@19400e7#diff-6802f9302b04d546cb9ec4a1106ca6c0R189

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

No branches or pull requests

3 participants