Description
Information about clip being played and blended by the Animator.
獲得Animator的當前AnimationClip和混合動畫的信息
Variables
clip | Returns the animation clip played by the Animator.返回當前播放的AnimationClip |
weight | Returns the blending weight used by the Animator to blend this clip.返回該AnimationClip在播放中所有AnimationClip的權重 |
Animator
GetCurrentAnimationClipState | Gets the list of AnimationInfo currently played by the current state.獲取當前狀態播放的當前動畫信息列表。 |
GetCurrentAnimatorStateInfo | Gets the current State information on a specified AnimatorController layer.獲取指定的AnimatorController層的當前狀態信息。 |
Animator anim = new Animator();//獲得Animator
AnimatorClipInfo[] animatorClipInfo = anim.GetCurrentAnimatorClipInfo(0);//獲得播放列表
AnimatorStateInfo animatorStateInfo = anim.GetCurrentAnimatorStateInfo(0);
foreach (AnimatorClipInfo a in animatorClipInfo) {
AnimationClip an = a.clip;
}
第三種方法
AnimationClip clip = NpcAnimator.runtimeAnimatorController.animationClips[0];
Debug.Log("animationClips[0]" + clip.name);