Animation.wrapMode Manual     Reference     Scripting  
Scripting > Runtime Classes > Animation
Animation.wrapMode

var wrapMode : WrapMode

Description

How should time beyond the playback range of the clip be treated?

WrapMode.Default: Read's the wrap mode from the clip (default for a clip is Once).
WrapMode.Once: Stops the animation when time reaches the end.
WrapMode.Loop: Starts at the beginning when time reaches the end.
WrapMode.PingPong: Ping Pong's back and forth between beginning and end.
WrapMode.ClampForever: Plays back the animation. When it reaches the end, it will keep sampling the last frame.

JavaScript
// Make the animation loop
animation.wrapMode = WrapMode.Loop;

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
void Example() {
animation.wrapMode = WrapMode.Loop;
}
}

import UnityEngine
import System.Collections

class example(MonoBehaviour):

def Example():
animation.wrapMode = WrapMode.Loop