Animation.IsPlaying 是否在播放?


function IsPlaying (name : string) : bool

Description描述

Is the animation named name playing?

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

  • C#

  • JavaScript

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");}


,