Comments (4)
Do you only want a subset of the tweens that you put in the GoTweenFlow to
be cancelled/destroyed? Why not destroy the entire GoTweenFlow?
- Michael
On Mon, Mar 7, 2016 at 4:41 AM, Matthijs Kooijman [email protected]
wrote:
I have a number of related tweens which should run simultaneously and,
sometimes, be canceled halfway collectively. I was hoping to use some kind
of collection (GoTweenFlow seems promising) to manage these tweens, but
AFAICS I can then only pause the tweens, not actually stop / destroy them
through the collection. I would have to keep a separate list of tweens to
call destroy() on, pretty much voiding the goal of the collection.Am I missing something, or is this something that could/should be added?
—
Reply to this email directly or view it on GitHub
#76.
from gokit.
No, I want to destroy them all. Looking at the code, GoTweenFlow does not override destroy(), so that would only make GoAbstractTweenCollection set its state to destroyed, not actually destroy the contained tweens. Though I haven't actually tested this, so I might have missed some bit of the code that makes this work, of course...
from gokit.
So to answer your question, there's a bit of context to give:
The only thing GoKit does with tweens is keep them in a list to update them
every frame.
Whenever you set any AbstractGoTween (which includes GoTween, GoTweenChain
and GoTweenFlow), we just set an internal state in the tween to mark it as
destroyed.
When Go.cs is looping through all running tweens, it will remove that class
from the list of tweens to update every frame.
The reason why you don't need to worry about the internal list of Tweens
for the GoTweenFlow is because the collection keeps track of all those
internal tweens, not the master Go.cs class. Destroying the GoTweenFlow
effectively will destroy the other objects.
In short, whenever you want to remove all the tweens in a GoTweenFlow, just
call destroy() on the GoTweenFlow.
Hope this helps!
- Michael
On Mon, Mar 7, 2016 at 12:33 PM, Matthijs Kooijman <[email protected]
wrote:
No, I want to destroy them all. Looking at the code, GoTweenFlow does not
override destroy(), so that would only make GoAbstractTweenCollection set
its state to destroyed, not actually destroy the contained tweens. Though I
haven't actually tested this, so I might have missed some bit of the
code that makes this work, of course...—
Reply to this email directly or view it on GitHub
#76 (comment).
from gokit.
Ah, I see. I was assuming that the other subclasses of AbstractGoTween would actually do something to remove themselves from the main list of running tweens in their destroy() methods, but that happens automatically by setting their state to destroyed, right.
Thanks for taking the time to explain, my doubts are answered! I should have just tried, instead of trying to figure out the code first :-p
from gokit.
Related Issues (20)
- GoDummyPathEditor "Shift Path to Start at Origin" seems to be incorrect
- AbstractGoTween.goTo does not update rotation HOT 1
- Android streaming GoSpline asset bug? HOT 2
- Built-in support for inserting functions into GoTweenCollections HOT 6
- Docs: link not working anymore (README.md) HOT 3
- Doesn't compile for Windows Phone 8 HOT 1
- What do you think about rearranging this repo so it could be a submodule or a subtree? HOT 5
- GoTween Incompatible with IL2CPP scripting backend HOT 14
- [Question] Player Camera on Path HOT 1
- Non functioning Tween when reusing a GoTween instance with modified TweenProperties HOT 5
- Changing the speed/during of a GoTween/GoTweenChain while it is playing HOT 2
- Is there a way to save all running tweens? HOT 1
- Need help with playBackwards() HOT 3
- How to check if Go has no animation running HOT 2
- [FEATURE REQUEST] ECS Support HOT 2
- [Request] Tween value without using property HOT 6
- Tweening Rotations Shortest Distance HOT 1
- Is there a way to queue Tweens by GoKit itself?
- Documentation installation (via github?) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gokit.