WaitForAnim
A Unity-package for waiting for animations in coroutines.
Check out the wiki here.
Found any issues? Leave them here.
Want to see what's new? The changelog is here.
Features
Start an animation and wait for it to finish
If you want to wait for an animation to stop playing, you can use WaitForAnimationToFinish.
yield return new WaitForAnimationToFinish(animator, "MyAnim");You can also start an animation and wait for it to finish using the extension method PlayAndWait.
yield return animator.PlayAndWait("MyAnim");Wait for an animation to start
If you want to wait for an animation to start playing, you can use WaitForAnimationToStart.
yield return new WaitForAnimationToStart(animator, "Test");Installation
The quickest way is to install via OpenUPM
using openupm add dev.comradevanti.wait-for-anim.
Or install manually
as git dependency
from https://github.com/ComradeVanti/UnityWaitForAnim.git or download as zip
and import locally.
Compatability
Developed with Unity 2020.3 but good chance that it will work with earlier versions, though this has not been tested.