When I set :
animationSet.setFillAfter(true);
The view holds the animated state there after. But before doing another animation, I need to reset the state to the old one. What I need is something like :
animationSet.resetFillAfter(true);
How can I achieve this? Is it possible?
Just for the record, you can also affect the playing state of a CSS animation through JavaScript, like pausing and restarting it. Obviously consider the other vendor prefixes properties. Interestingly, the natural end of a CSS animation doesn’t set the play state to “paused”.
With CSS animations (ala @keyframes) it’s not as easy as you might think to “restart” it. Let’s say you set it to run once: You have that run on, say, your logo: Then for some reason you want to have that animation run again, perhaps on a click. You might think CSS provides a way to kick it off again, but as far as I know it doesn’t.
Well, it depends. For example, when i start the game, my default animation is set to be idle. Then whenever i press any button, my animation transitions to another animation, when i stopped pressing any button it transitions back to my idle animation.
It returns the AnimatorController to the Entry state: This isn't the solution but there REALLY should be something as simple as Unity having some in-built function that when you use gameObject.SetActive (false); you can also select to save the object's states or not.
You can call yourView.clearAnimation()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With