本文整理汇总了C#中UnityEngine.Animation.CrossFadeQueued方法的典型用法代码示例。如果您正苦于以下问题:C# Animation.CrossFadeQueued方法的具体用法?C# Animation.CrossFadeQueued怎么用?C# Animation.CrossFadeQueued使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.Animation
的用法示例。
在下文中一共展示了Animation.CrossFadeQueued方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PlayAnimation
private bool PlayAnimation(Animation animation, string name)
{
bool b = false;
if(animation != null && name != "" && animation[name] != null)
{
if(this.show) animation[name].layer = this.min;
if(this.playOptions[this.number] == "Play")
{
animation.Play(name, this.playMode);
}
else if(this.playOptions[this.number] == "CrossFade")
{
animation.CrossFade(name, this.time, this.playMode);
}
else if(this.playOptions[this.number] == "Blend")
{
animation.Blend(name, this.speed, this.time);
}
else if(this.playOptions[this.number] == "PlayQueued")
{
animation.PlayQueued(name, this.queueMode, this.playMode);
}
else if(this.playOptions[this.number] == "CrossFadeQueued")
{
animation.CrossFadeQueued(name, this.time, this.queueMode, this.playMode);
}
b = true;
}
return b;
}
示例2: metcrossfadetransitionanimation
public static int metcrossfadetransitionanimation(Transform varpcharacter, string varpdestinationanimname, float varptransitiontime, Transform varpcontroller = null, string varpstateanimationname = "", bool varpgokinematic = true, string varpnewanimname = "transition", Animation varpanimationsystem = null, SkinnedMeshRenderer varprenderer = null, clsurganimationstatesmanager varpstatesmanager = null)
{
if (varpcharacter == null)
{
return -1;
}
if (varptransitiontime == 0f)
{
return -2;
}
if (varpanimationsystem == null)
{
varpanimationsystem = varpcharacter.root.GetComponentInChildren<Animation>();
if (varpanimationsystem == null)
{
return -3;
}
varpanimationsystem.Stop();
}
if (varprenderer == null)
{
varprenderer = varpcharacter.root.GetComponentInChildren<SkinnedMeshRenderer>();
if (varprenderer == null)
{
return -4;
}
}
if (varpgokinematic)
{
clsurgutils.metgodriven(varpcharacter, true);
}
Vector3 localPosition = default(Vector3);
if (varpcontroller != null)
{
Vector3 position = varpcharacter.position;
varpcontroller.position = position;
varpcharacter.localPosition = localPosition;
}
AnimationClip animationClip = clsurgutils.metcreatetransitionanimation(varpcharacter, varpdestinationanimname, varptransitiontime, varpnewanimname, ref localPosition, varpstatesmanager, false);
if (animationClip != null)
{
varpanimationsystem.Stop();
AnimationState animationState = varpanimationsystem[varpdestinationanimname];
if (animationState != null && animationState.name != varpdestinationanimname)
{
varpanimationsystem.RemoveClip(varpnewanimname);
}
varpanimationsystem.AddClip(animationClip, varpnewanimname);
if (varpstateanimationname != string.Empty)
{
varpanimationsystem[varpnewanimname].wrapMode = WrapMode.Once;
varpanimationsystem.CrossFade(varpnewanimname);
varpanimationsystem.CrossFadeQueued(varpstateanimationname);
}
else
{
varpanimationsystem.CrossFade(varpnewanimname);
}
return 1;
}
Debug.LogError("Could not create transition");
return -5;
}