I need to play like a pop-out animation (growing smaller) and after that move the UI-Elements from the animation out of the canvas.
I've tried various things, like
bool AnimatorIsPlaying(){
return animator.GetCurrentAnimatorStateInfo(0).length >
animator.GetCurrentAnimatorStateInfo(0).normalizedTime;
}
or
bool AnimatorIsPlaying(){
return animator.GetCurrentAnimatorStateInfo(0).normalizedTime < 1;
}
and more, almost all from this https://answers.unity.com/questions/362629/how-can-i-check-if-an-animation-is-being-played-or.html question.
Sometimes, the things, if in an if clause with the bools, didn't move out at all, or they moved out too soon, like if nothing even was added. I've even tried making the method a IEnumerator so that I could do a yield return new WaitForSecondsRealtime(0.25f) but then I couldn't call the method from an other class anymore(which IS neccessary).
Now I've found an Method which is just calling an method from the other class and then starting a Coroutine with yield return new WaitForSecondsRealtime(0.25f). But is there a better method and why da frick was it not working?