首页 > 其他 > 详细

根骨骼运动原始实现代码

时间:2016-04-04 01:28:23      阅读:297      评论:0      收藏:0      [点我收藏+]

实测过确实可行

 

技术分享
public class TestSMB : StateMachineBehaviour
{
    public override void OnStateMove(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        Vector3 velocity = animator.deltaPosition / Time.deltaTime;

        var rigidbody = animator.GetComponent<Rigidbody>();

        if (rigidbody != null)
        {
            velocity.y = rigidbody.velocity.y;

            rigidbody.velocity = velocity;
        }
    }
}
View Code

 

根骨骼运动原始实现代码

原文:http://www.cnblogs.com/hont/p/5351275.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!