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.Default:从动画剪辑中读取循环模式(默认是Once)。

WrapMode.Once: Stops the animation when time reaches the end.
 WrapMode.Once:当时间播放到末尾的时候停止动画的播放。

WrapMode.Loop: Starts at the beginning when time reaches the end.
WrapMode.Loop:当时间播放到末尾的时候重新播放从开始播放。

WrapMode.PingPong: Ping Pong's back and forth between beginning and end.
 WrapMode.PingPong:在开始和结束之间来回播放。  

WrapMode.ClampForever: Plays back the animation. When it reaches the end, it will keep sampling the last frame.
WrapMode.ClampForever:播放动画。当播放到结尾的时候,动画总是处于最后一帧的采样状态。

  • C#

  • JavaScript

using UnityEngine;using System.Collections;public class example : MonoBehaviour {public void Awake() {animation.wrapMode = WrapMode.Loop;}}
//Make the animation loop//使用动画循环模式。animation.wrapMode = WrapMode.Loop;


,