Run a one-shot system upon completion of Tween or Delay - #111
Conversation
|
I tried my best to include some unit tests to maintain symmetry with the other "with_completed" methods, but I ran into a snag when dealing with the tick tests. I had to create some dummy values in Oh, and I just realized I forgot to update the examples. I can get to that as soon as I get some feedback on what I managed to to commit so far :) |
djeedai
left a comment
There was a problem hiding this comment.
I think the change makes sense, thanks a lot! Couple of comments on docs, and I don't know why it seems CI didn't start? I'll check that too as I expect docs won't build. Other than that looks good to me.
Peepo-Juice
left a comment
There was a problem hiding this comment.
This was as a result of me trying to update my local repo and manage a conflict. I feel like I screwed up and created this ugly commit. My bad! I'm still getting the hang of Git.
djeedai
left a comment
There was a problem hiding this comment.
I'm conceptually on board but there's a number of minor things to fix. Let me know if you don't have time to, I can take over and finish it. Thanks!
This PR adds with_completed_system() and other related methods to allow the user to run a one-shot system when an animation or delay completes.
The main reason why I wanted to add this is to avoid polling for a single non-repeating event; using one-shot systems can be cleaner sometimes. But there are other use-cases like chaining actions or even other animations that cant be chained normally due to limitations in the library. In those cases you may think to use callbacks, but they don't allow you to easily interact with the world, which makes one-shot systems a necessity.