本文整理匯總了C#中UnityEngine.Animation.IsPlaying方法的典型用法代碼示例。如果您正苦於以下問題:C# Animation.IsPlaying方法的具體用法?C# Animation.IsPlaying怎麽用?C# Animation.IsPlaying使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類UnityEngine.Animation
的用法示例。
在下文中一共展示了Animation.IsPlaying方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ICheckAnimationComplete
public static IEnumerator ICheckAnimationComplete(Animation targetAnimation, string targetAnimatedName, GameObject callbackObj, string callbackFunction)
{
do
{
yield return null;
} while (targetAnimation.IsPlaying(targetAnimatedName));
Debug.Log(targetAnimatedName + " finish !");
// here ! call back to delegation obj.
if (callbackObj != null)
callbackObj.SendMessage (callbackFunction, SendMessageOptions.DontRequireReceiver);
else
OnTargetAnimationComplete_event (EventArgs.Empty);
}
示例2: QueueIdle
private IEnumerator QueueIdle(Animation source)
{
while (source.IsPlaying(_ClipName))
yield return new WaitForFixedUpdate();
source.CrossFade(AnimationResources.Idle);
}
示例3: primaryAnimator
protected void primaryAnimator(float speed, float time, WrapMode wrap, string name, Animation a)
{
if (a != null)
{
a[name].speed = speed;
if (!a.IsPlaying(name))
{
a[name].wrapMode = wrap;
a[name].normalizedTime = time;
a.Blend(name, 1f);
}
}
}
示例4: playAnimation
private void playAnimation(Animation animation, AnimationClip clip)
{
if(!animation.IsPlaying(clip.name)) {
animation.Play(clip.name);
}
}
示例5: blendAnimation
private void blendAnimation(Animation animation, AnimationClip clip)
{
if(!animation.IsPlaying(clip.name)) {
animation.Blend(clip.name, 4f);
}
}
示例6: lightAnimator
private void lightAnimator(Animation a, string name, bool stop)
{
if (!a.IsPlaying(name) && !stop)
{
a[name].speed = 1f;
a[name].normalizedTime = 0f;
a[name].wrapMode = WrapMode.Loop;
a.Blend(name);
}
else if (stop)
{
a[name].normalizedTime = a[name].normalizedTime % 1;
a[name].wrapMode = WrapMode.Clamp;
}
}
示例7: animator
//Controls the main, door-opening animation
private void animator(float speed, float time, Animation a, string name)
{
if (a != null)
{
a[name].speed = speed;
if (!a.IsPlaying(name))
{
a[name].normalizedTime = time;
a.Blend(name, 1f);
}
}
}
示例8: AnimationStillPlaying
/// <summary>
/// 判斷動作是否播放完畢
/// </summary>
/// <param name="animationName"></param>
/// <returns></returns>
private bool AnimationStillPlaying(Animation animation, string animationName)
{
return animation.IsPlaying(animationName) && animation[animationName].normalizedTime < 1.0f;
}