本文整理汇总了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;
}