unity, Additive Animtion注意事项
2016-07-26 12:00
603 查看
以下摘自官方文档:(http://docs.unity3d.com/Manual/AnimationScripting.html)
Additive animations allow you to overlay the effects of one animation on top of any others that may be playing. When generating additive animations, Unity will calculate the difference between the first frame in the animation clip and the current frame. Then it will apply this difference on top of all other playing animations.
Tip: When using Additive animations, it is critical that you also play some other non-additive animation on every transform that is also used in the additive animation, otherwise the animations will add on top of the last frame’s result. This is most certainly not what you want.
其中包含三个要点:
1,Additive动画第一帧是参考帧,其余帧与之求差值。也就是说对于Additive动画而言,各帧是什么样并无卵用,有用的是各帧与第一帧的差值。
2,对于一个Transform,只对其播放Additive动画,可能产生非预期行为。正确的做法是在对一个Transform的某个属性P播放Additive动画的时候至少保证此Transform的属性P同时也在播放着某个非Additive动画,即Additive动画需要一个Base动画作为基础。
3,Additive动画的animationLayer值要比相应的Base动画的animationLayer值大。(参考:http://answers.unity3d.com/questions/218370/basic-question-about-additive-animation.html)
补充:
经过试验,如果一个Transform的某属性P没有相应的Base动画,那么在此Additive动画开始播放时用代码强制设置此Transform的属性P第一帧的值也可以避免additive动画出现非预期行为。
参考:
http://forum.unity3d.com/threads/weird-additive-animation-behavior.40250/ http://answers.unity3d.com/questions/218370/basic-question-about-additive-animation.html
Additive animations allow you to overlay the effects of one animation on top of any others that may be playing. When generating additive animations, Unity will calculate the difference between the first frame in the animation clip and the current frame. Then it will apply this difference on top of all other playing animations.
Tip: When using Additive animations, it is critical that you also play some other non-additive animation on every transform that is also used in the additive animation, otherwise the animations will add on top of the last frame’s result. This is most certainly not what you want.
其中包含三个要点:
1,Additive动画第一帧是参考帧,其余帧与之求差值。也就是说对于Additive动画而言,各帧是什么样并无卵用,有用的是各帧与第一帧的差值。
2,对于一个Transform,只对其播放Additive动画,可能产生非预期行为。正确的做法是在对一个Transform的某个属性P播放Additive动画的时候至少保证此Transform的属性P同时也在播放着某个非Additive动画,即Additive动画需要一个Base动画作为基础。
3,Additive动画的animationLayer值要比相应的Base动画的animationLayer值大。(参考:http://answers.unity3d.com/questions/218370/basic-question-about-additive-animation.html)
补充:
经过试验,如果一个Transform的某属性P没有相应的Base动画,那么在此Additive动画开始播放时用代码强制设置此Transform的属性P第一帧的值也可以避免additive动画出现非预期行为。
参考:
http://forum.unity3d.com/threads/weird-additive-animation-behavior.40250/ http://answers.unity3d.com/questions/218370/basic-question-about-additive-animation.html
相关文章推荐
- Fill-rate,Canvases and input 填充率,画布和输入—(Unity3d)
- unity场景加载,及协同程序
- unity 协程 实现物体颜色动态切换
- Unity3D之Vector3.Dot和Vector3.Cross的使用
- Unity_游戏源码
- 【Unity】新的UI系统技巧2
- 构建ASP.NET MVC5+EF6+EasyUI 1.4.3+Unity4.x注入的后台管理系统(65)-MVC WebApi 用户验证 (1)
- unity调用java
- Unity知识点整理
- unity生成以及xcode命令行打包ipa以及签名
- unity3d 第十四天
- 避开unity的坑(转摘)
- 使用Unity3D的50个技巧
- Unity3d特效DrawCall优化介绍
- unity 简单编辑器的扩展应用—1
- unity3d培训_006
- unity和android通信注意点
- Unity Aspect
- Unity获取系统鼠标
- Unity 5.0之后 Animation.AddClip 无效