Unity3D圣典3.3版本-中文版
文集大纲加载中……
本文档使用 MrDoc 发布
-
+
首页
AnimationState.weight 权重
# [AnimationState](AnimationState.html).weight 权重 var *weight* : float *Description* 描述 The weight of animation 动画权重 This calculates the blend weights for one curve. 它计算动画曲线的混合权重 Weights are distributed so that the top layer gets everything. If it doesn't use the full weight then the next layer gets to distribute the remaining weights and so on. Once all weights are used by the top layers, no weights will be available for lower layers anymore Unity uses fair weighting, which means if a lower layer wants 80% and 50% have already been used up, the layer will NOT use up all weights. instead it will take up 80% of the 50%. 权重分配从最高层获取.如果最高层没有获取全部权重,其下一层将获取其余的权重并以此类推.一旦顶层使用了全部权重,较低层将没有权重可用.这意味着在上层已经占用 50% 的情况下低层想占用 80% 时,此层占用的将不是全部权重的 80%,而是 50% 中的 80%. Example: a upper body which is affected by wave, walk and idle a lower body which is affected by only walk and idle weight name layer lower upper ``` 20% wave 2 0% 20% 50% walk 1 50% 40% 100% idle 0 50% 40% ``` 例如: 上体受 wave,walk 和 idle 影响,下体受 walk 和 idle 影响. ``` 20% wave 2 0% 20% 50% walk 1 50% 40% 100% idle 0 50% 40% ``` Blend weights can change per animated value because of mixing. Even without mixing, sometimes a curve is just not defined. Still you want the blend weights to add up to 1. Most of the time weights are similar between curves. 混合权重靠混合来改变动画.甚至没有混合,有时连动画曲线都没有定义,你仍可以将混合权重加到 1.多处情况下曲线中的权重是一致的. * [C#](#) * [JavaScript](#) ``` using UnityEngine; using System.Collections; public class example : MonoBehaviour { public void Awake() { animation["Walk"].enabled = true; animation["Walk"].weight = 1.0F; } } ``` ``` // Enable the walk cycle // 启用行走动作循环 animation["Walk"].enabled = true; animation["Walk"].weight = 1.0; ```
da
2022年5月13日 22:24
转发文档
收藏文档
上一篇
下一篇
手机扫码
复制链接
手机扫一扫转发分享
复制链接
关于 MrDoc
觅思文档MrDoc
是
州的先生
开发并开源的在线文档系统,其适合作为个人和小型团队的云笔记、文档和知识库管理工具。
如果觅思文档给你或你的团队带来了帮助,欢迎对作者进行一些打赏捐助,这将有力支持作者持续投入精力更新和维护觅思文档,感谢你的捐助!
>>>捐助鸣谢列表
微信
支付宝
QQ
PayPal
Markdown文件
分享
链接
类型
密码
更新密码