How to translate this sentence into a C #

How to translate this sentence into a C # code? “After the last animation (of 5), the object reappears at a random place with the first animation.”

Probably best to start here: Learn

I already have the spawn script, my object changes animation when I click it. Can’t call this spawn right after the “last animation”? unity learn has nothing to do with my doubt

You can call a method from the animator if you wish. Unity learn has tutorials on how to do that.