首先,在5.0 中,对于每个State 、Bleed Tree 可以给他们添加脚本,就像控制角色模型一样
using UnityEngine; using System.Collections; public class State : StateMachineBehaviour { // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { } // OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { } // OnStateExit is called when a transition ends and the state machine finishes evaluating this state override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { } // OnStateMove is called right after Animator.OnAnimatorMove(). Code that processes and affects root motion should be implemented here override public void OnStateMove(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { } // OnStateIK is called right after Animator.OnAnimatorIK(). Code that sets up animation IK (inverse kinematics) should be implemented here. // 反向动力学 , 有反向动力学时调用. // override public void OnStateIK(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { } }
OnStateIK() 是用来写反向动力学的 . 学习下关于什么是方向动力学 http://blog.csdn.net/huang9012/article/details/18183437