How to change animations every 60 seconds through the animator in Unity3D and C# Visual?

I made several animations clips on a character through the animator in Unity.

And I added a countdown timer which is a Text Ui component from a canvas. It is initially 00, but when I play the start button it decrease from 60 by 1 to 0, during which time animation1 repeats. When the timer reaches 0 I want the animation to change, so from animation1 to enter animation2.

Above is the code for the timer and the if condition where I managed to do this with a bolean parameter from animator and an if condition in a C # script.

But when the timer ran out a second time and reached 0 I want it to go from ‘animation2’ to ‘animation3’ and the parameter ‘change’ to become false and the parameter ‘change1’ to become true. And so, every time the timer reaches 0 another animation to load.

Is there any way I can do this?

You could use Animation.Play("animClipname"); and Animation.Stop(); to play the next animation clip in the animation. For example:

public Animator animator;

void Start()
{
     StartCoroutine(PlayAnimations(60));
}

IEnumerator PlayAnimations(float time)
{
     int index = 0;

     while (true)
     {
          yield return new WaitForSeconds(time);
          animator.Stop();
          animator.Play("AnimationClip" + index.ToString());
          index++;
     }
}

@agathachritie90