Animation stop looping script?

I need one because i couldn’t find it. and I used legacy version. I followed a tutorial a while ago and It would take all day to redo it. whats the stop looping animation script?

You just call Animation.wrapmode

// Make the animation loop
	animation.wrapMode = WrapMode.Loop;
// Make the animation play once
	animation.wrapMode = WrapMode.Once;