Animation.isPlaying 是否在播放?

var isPlaying : bool

Description描述

Are we playing any animations?

是否在播放任何动画?

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	void OnMouseEnter() {
		if (!animation.isPlaying)
		animation.Play();

	}
}
// Plays an animation only if we are not playing it already.
// 只在我们没有播放一个动画的时候,播放它。
function OnMouseEnter() {
	if (!animation.isPlaying)
		animation.Play();
}
Page last updated: 2011-1-12