2.12 动画系统进阶

来源:互联网 发布:软件系统分析 编辑:程序博客网 时间:2024/05/24 01:57
day12 动画系统进阶

一,动画层
在 Unity 中可以使用动画层来管理不同类型的动画分层处理
注:当权重都是1的时候,后面优先于前面的,如上图,JumpLayer会压制flaseLayer的动作.
二,动画遮罩
当设置完动画层,有些动作并冲突,怎么同时运行呢?这里就需要动画遮罩.
在 Project面板下创建一 个 Avatar Mask
红色为禁用,这样在其他图层就可以用了.
加入如第一张的Mask中.

三,IK动画
脚本:
● 脚本控制 animator.SetIKPositionWeight(AvatarIKGoal.RightHand, 1); animator.SetIKRotationWeight(AvatarIKGoal.RightHand, 1); if (ikActive) { animator.SetIKPosition(AvatarIKGoal.RightHand,rightHandObj.position); animator.SetIKRotation(AvatarIKGoal.RightHand,rightHandObj.rotation); } else{ animator.SetIKPositionWeight(AvatarIKGoal.RightHand, 0); animator.SetIKRotationWeight(AvatarIKGoal.RightHand, 0); }

四,动画曲线
五,动画事件


原创粉丝点击