Animation.IsPlaying 是否在播放?

function IsPlaying (name : string) : bool

Description描述

Is the animation named name playing?

名为name的动画正在播放吗?

using UnityEngine;
using System.Collections;

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

	}
}
// Plays an animation only if we are not playing it already.
//仅当不播放时,播放动画
function OnMouseEnter() {
	if (!animation.IsPlaying("mouseOverEffect"))
		animation.Play("mouseOverEffect");
}
Page last updated: 2011-1-13