-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add destroy method to Playable #64
base: master
Are you sure you want to change the base?
Conversation
Yo! The problem with immediately removing a tween is that it might translate into some weird behaviors if the tween's Also, instead of duplicating the |
Thanks for the quick answer 😃 As for the I will make the changes to avoid the duplicated logic. |
return true; | ||
if (immediate) { | ||
playable._handle = this._activePlayables.removeByReference(playable._handle); | ||
return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If true in both cases, maybe more elegant to move the return statement to after the else
?
Hello, Is there anything I can do to push this PR forward? |
Unit tests? |
@bchevalier I assume this is because doubly list is nulling out the next and previous on the removed node, therefore it may stop iterating? Which, coincidentally, is not included on your 'container-doublylist' |
Description
As pointed out in #63, whenever a tween is stopped, its update and complete can still trigger in the same tick.
This PR adds a
destroy
method toPlayable
which immediately removes the tween. As the tween is removed immediately, its update and complete do not trigger in the same tick.poke @ronkorving @cainmartin @bchevalier