Comments (13)
I really wonder why this library doesn't contain sequencing function. Every developer with sane mind would not even forget it, it will be on the top of their TODO list. Unbelievable, lackluster approach on developing the API.
For example, as suggested here, use onComplete. Here is what my code looks like. It looks like it has been coded by 5 year old, such a mess:
LeanTween .scale (goldCollectedText.gameObject, new Vector3 (1f, 1f, 1f), 0.15f) .setOnComplete (() => { LeanTween .scale(goldCollectedValue.gameObject, new Vector3(1f, 1f, 1f), 0.15f) .setOnComplete(() => { LeanTween .scale(highestGoldCollectedText.gameObject, new Vector3(1f, 1f, 1f), 0.15f) .setOnComplete(()=> { LeanTween .scale(highestGoldCollectedValue.gameObject, new Vector3(1f, 1f, 1f), 0.15f) .setOnComplete(OnGameOverButtonsEnter) .setEase(LeanTweenType.easeOutBounce); }) .setEase(LeanTweenType.easeOutBounce); }) .setEase(LeanTweenType.easeOutBounce); }) .setEase (LeanTweenType.easeOutBounce);
Can't believe I have to write my own sequence method to get this done. Unbelievable. ADD IT! Quickly!
from leantween.
@neonwarge04 A sequencer is just syntax sugar... So no, @dentedpixel didn't forget it. And no, it shouldn't be the top of his TODO list. And his effort regarding LeanTween is certainly not "lackluster"; it's one of the, if not the API with the best syntax-design and optimization.
If your code looks like that, it's because you've made it like that. Creating your own sequencer for LeanTween is not hard, and even if that was the case, neither is it hard to implement the same thing you did, in a more sane manner, instead of making that mess you've made.
Yes, sequencing functionality would be welcome, but no, it's not something of which the API needs. @dentedpixel is welcome to implement it (or not) at his discretion, but he should have no obligation to do your syntax-sugaring for you.
from leantween.
I have started a sequencer, please check out the sequencer example scene: GeneralSequencer
Right now it's pretty basic, no ability to play a sequence backwards or anything fancy like that.
Also before releasing I will make sure it's done in a way that doesn't effect garbage collection.
from leantween.
Hey Shinriyo,
I wasn't planning on adding this function. I personally prefer to just add delays in order to get a chain of events to run... but I could see where this might be handy.
I was going to look into making sure inline onComplete functions worked, so in a sense if you had those you could setup sequences easily. I think I could build those out with either Lambdas or Anonymous functions... (I have to look into what might work, but just in case you wanted to explore a possible solution as well)
from leantween.
Yes. I know the onComplete function.
I coded the function.
https://gist.github.com/shinriyo/452c9c96ffbfdfc8653e
I can use the sequence like below 👍
float[] xs = new float[] {10, 0, -100};
float[] times = new float[] {0.8f, 0.9f, 1.8f};
LeanTweenSequence.MoveLocalX (enemyTurnMessage.gameObject, xs, times);
I will create the move functions too. 😊
from leantween.
Hey Shinriyo,
Very cool, I am trying to think what makes the most sense for coding this type of functionality. I think it might make sense to just add it into the moveLocalX method, so if the user is passing an array of floats it knows to make it a sequence...
This way you could still chain optional parameters on to it as well...
from leantween.
+1
from leantween.
Sequencing function would help when trying to apply multiple tweens to the same object from different threads. Struggling with this issue right now. Tried calling LeanTween.cancel on the gameObject but that obviously doesn't finish the execution of the tween.
from leantween.
You can call LeanTween.cancel( gameObject, doesComplete) with a doesComplete = yes which will call any onComplete methods on the cancelled tweens. Or were you thinking you would want all the tweens to get to their end positions as well? Let me think about the sequencer feature again, since it seems to be an often requested add on...
from leantween.
Yes, was looking to have them get to their end positions as well.
Thinking of building a timeline helper class that would sequence the tweens
for gameobjects
On Sun, 13 Sep 2015 at 23:27 Russell Savage [email protected]
wrote:
You can call LeanTween.cancel( gameObject, doesComplete) with a
doesComplete = yes which will call any onComplete methods on the cancelled
tweens. Or were you thinking you would want all the tweens to get to their
end positions as well? Let me think about the sequencer feature again,
since it seems to be an often requested add on...—
Reply to this email directly or view it on GitHub
#25 (comment)
.
from leantween.
Ah ok, yeah the LeanTween Visual Editor works a lot like a timeline editor, if you want to give that a shot. Or you could build your own, that would be cool too.
You can do a bit of a sequencer like steps by using the delayedCall method in a manner like:
int delayedId = LeanTween.delayedCall(gameObject, 4f, ()=>{
LeanTween.moveY(gameObject, 2f, 3f).setFrom(1f));
LeanTween.scaleX(gameObject, 0f, 1f).setDelay(3f).setFrom(2f);
}).setRepeat(3).setOnCompleteOnStart(true);
// has that sequence of moveY and scaleX repeat 3 times
from leantween.
I meant a Timeline editor to manage sequential tweens kind of like the greensock Timeline Library(http://greensock.com/timelinemax) it manages the sequence of tweens and their execution.
The problem I'm facing right now is that once a tween starts executing and external input adds another tween to the same gameObject, There's no way for me to sequence that on top of the previous tween. If the LeanTween.cancel( gameObject, doesComplete) would complete the running tween it would solve the problem.
But I think long term it would benefit a lot from having a sequencer and the flexibility to manage those things.
from leantween.
Thank you for your efforts.
from leantween.
Related Issues (20)
- Any way to know how many instances of LeanTween is running? HOT 1
- isPaused copy-paste error
- Package Manager shipping ? HOT 1
- Please continue this magnificent package. Don't let it die... HOT 3
- "EndlessPiece" has missing script HOT 6
- LeanTween.move inconsistent HOT 3
- LeanTween.delayedCall does not clear when tween finishes
- Editor List renderer problem with Unity 2021.1 or higher.
- Unexpected pause & resume behavior HOT 2
- Documentation website isn't opening HOT 1
- SetFrom with SetDelay
- Does not contain sequence HOT 1
- Type or namespace 'LTSeq' could not be found HOT 3
- Weird bugs from .setIgnoreTimeScale(false) HOT 2
- Errors - Downloaded from Asset store getting Assets\LeanTween\Framework\LeanTweenExt.cs(31,166): error CS1503: Argument 3: cannot convert from 'System.Action' to 'Action' HOT 2
- Documentation Website not available HOT 3
- LeanTween.delayedCall() is bugged/unreliable, will occasionally not perform call HOT 3
- Rotation and Value Tween stopping even when no cancel called HOT 1
- LeanTween.scale seems to run perfectly first run, after it stop to run HOT 2
- Image alpha bug.
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 leantween.