Unity3D圣典3.3版本-中文版
文集大纲加载中……
本文档使用 MrDoc 发布
-
+
首页
Animation.SyncLayer 同步层
# [Animation](Animation.html).SyncLayer 同步层 function *SyncLayer* (*layer* : int) : void *Description* 描述 Synchronizes playback speed of all animations in the layer. 同步某层的动画的播放速度。 When blending between two looping animations they often have different lengths. For example a walk cycle often takes longer than a run cycle. When blending between them you need to make sure that the foot placement of the walk and run cycle happens at the same time. In other word playback speed of the animations must be adjusted so that the animations are synchronized. SyncLayer will calculate the average normalized playback speed of all animations in the layer based on their blend weight. Then it will apply that playback speed to all animations in the layer. 在混合两个循环动画的时候,他们通常有不同的长度。比如一个走路的动画通常比一个跑步的动画要长。当混合他们的时候,你需要确定走路和跑步动画发生的时候脚的位置要在同一时间走动。换句话说,这两个动画播放速度要被调整一致,以便动画的同步。SyncLayer 函数将根据动画的混合权重来计算同一层中动画的平均正常播放速度。然后它会给同一层的所有动画应用这个播放速度。 * [C#](#) * [JavaScript](#) ``` using UnityEngine; using System.Collections; public class example : MonoBehaviour { public void Awake() { animation["walk"].layer = 1; animation["run"].layer = 1; animation.SyncLayer(1); } } ``` ``` // Puts the walk and run animation in the same // layer and synchronizes their speed // 把walk和run动画放到同一层,然后同步他们的速度。 animation["walk"].layer = 1; animation["run"].layer = 1; animation.SyncLayer(1); ```
da
2022年5月13日 22:09
转发文档
收藏文档
上一篇
下一篇
手机扫码
复制链接
手机扫一扫转发分享
复制链接
关于 MrDoc
觅思文档MrDoc
是
州的先生
开发并开源的在线文档系统,其适合作为个人和小型团队的云笔记、文档和知识库管理工具。
如果觅思文档给你或你的团队带来了帮助,欢迎对作者进行一些打赏捐助,这将有力支持作者持续投入精力更新和维护觅思文档,感谢你的捐助!
>>>捐助鸣谢列表
微信
支付宝
QQ
PayPal
Markdown文件
分享
链接
类型
密码
更新密码