looping an animation

have an fbx imported monkey and animation imported monkey@dancing. With the script here below i can press a button on the screen and the monkey does the dance animation. How can I set it so the animation keeps looping?

=================
using UnityEngine;
using System.Collections;

public class monkey : MonoBehaviour
{

public void OnGUI()
{

Rect r = new Rect(10, 10, 150, 50);
DrawButton(“dancing”, r);

public void DrawButton(string n, Rect r)
{

if( GUI.Button(r, n) )
{
robot.animation.Play(n);

}
}

}

This line should work. Use this before playing your animation.

robot.animation.wrapMode = WrapMode.Loop;