I am trying to play my animator's animation 5 times. That is after every animation that ends, it has to replay it for another time. How do I do this?
public Animator anim;
void Start ()
{
StartCoroutine(PlayAnimInterval(5));
}
private IEnumerator PlayAnimInterval(int n)
{
while (n > 0)
{
anim.Play("wave", -1, 0F);
--n;
//yield return new WaitForSeconds(anim.GetCurrentAnimatorStateInfo(0).length); //Returns 1 which is wrong
}
}


