本文整理匯總了C#中UnityEngine.Animator.CrossFade方法的典型用法代碼示例。如果您正苦於以下問題:C# Animator.CrossFade方法的具體用法?C# Animator.CrossFade怎麽用?C# Animator.CrossFade使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類UnityEngine.Animator
的用法示例。
在下文中一共展示了Animator.CrossFade方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: OnEnter
public override void OnEnter()
{
// get the animator component
var go = Fsm.GetOwnerDefaultTarget(gameObject);
if (go==null)
{
Finish();
return;
}
_animator = go.GetComponent<Animator>();
if (_animator!=null)
{
int _layer = layer.IsNone?-1:layer.Value;
float _normalizedTime = normalizedTime.IsNone?Mathf.NegativeInfinity:normalizedTime.Value;
_animator.CrossFade(stateName.Value,transitionDuration.Value,_layer,_normalizedTime);
}
Finish();
}
示例2: Activate
// Activate a Mecanim animation
private void Activate(Animator animator) {
if (animationState == empty) return;
if (resetNormalizedTime) animator.CrossFade(animationState, crossfadeTime, layer, 0f);
else animator.CrossFade(animationState, crossfadeTime, layer);
}
示例3: OnEnter
public override void OnEnter ()
{
animator = ownerDefault.GetComponent<UnityEngine.Animator> ();
animator.CrossFade (hash, transitionDuration, layer);
Finish ();
}