动画系统Animator内Interruption Source选项
None:关闭Interruption Source选项。
Current State:从当前源打断。
Next State:从下一个源打断。
Current State Then Next State:优先从当前源打断,如果当前源不能切换到下一个状态则从下一个源打断。
Next State Then Current State:则相反
Animator.Update
public void Update (float deltaTime);
根据 deltaTime 计算动画器。
故将当前动画播放时间设置为0,直接停止,并进行动画强行切换和融合
public static void ForceCrossFade(this Animator animator, string name, float transitionDuration, int layer = 0, float normalizedTime = float.NegativeInfinity)
{
animator.Update(0);
if (animator.GetNextAnimatorStateInfo(layer).fullPathHash == 0)
{
animator.CrossFade(name, transitionDuration, layer, normalizedTime);
}
else
{
animator.Play(animator.GetNextAnimatorStateInfo(layer).fullPathHash, layer);
animator.Update(0);
animator.CrossFade(name, transitionDuration, layer, normalizedTime);
}
}