Unity - Animation Layer syncing - 动画层的sync, timing作用

原文

Unity Manual - Animator - Animation Layers

只看:Animation Layer syncing部分就好

Animation Layer syncing

动画层sync(同步)

Sometimes it is useful to be able to re-use the same state machine in different layers. For example if you want to simulate “wounded” behavior, and have “wounded” animations for walk / run / jump instead of the “healthy” ones. You can click the Sync checkbox on one of your layers, and then select the layer you want to sync with. The state machine structure will then be the same, but the actual animation clips
used by the states will be distinct.

有时,能够在不同的层中重用相同的状态机是很有用的。例如,如果你想模拟“受伤”的行为,让“受伤”的动画代替“健康”的动画进行步行/跑步/跳跃。可以单击其中一个层上的“同步”复选框,然后选择要与之同步的层。状态机结构将是相同的,但实际的动画剪辑各州使用的将是不同的。(这里发现了何Animator Override Controller的功能很像)

This means the Synced layer does not have its own state machine definition at all - instead, it is an instance of the source of the synced layer. Any changes you make to the layout or structure of the state machine in the synced layer view (eg, adding/deleting states or transitions) is done to the source of the synced layer. The only changes that are unique to the synced layer are the selected animations used within each state.

这意味着同步层根本没有自己的状态机定义——相反,它是同步层源的实例。在同步层视图中对状态机的布局或结构所做的任何更改(例如,添加/删除状态或转换)都将对同步层的源进行。对同步层唯一的更改是在每个状态中使用的选定动画。

The Timing checkbox allows the animator to adjust how long each animation in synced layers takes, determined by the weight. If Timing is unselected then animations on the synced layer will be adjusted. The adjustment will be stretched to the length of the animation on the original layer. If the option is selected the animation length will be a balance for both animations, based on weight. In both cases (chosen and not chosen) the animator adjusts the length of the animations. If not chosen then the original layer is the sole master. If chosen, it is then a compromise.

“Timing”复选框允许Animator调整同步层中每个动画所需的时间(由权重决定)。如果未选择Timing,则将调整同步层上的动画。调整将拉伸到原始层上动画的长度。如果选择该选项,则动画长度将根据权重平衡两个动画。在这两种情况下(选中和未选中),Animator都会调整动画的长度。如果未选择,则原始层是唯一的主层。如果被选中,那就是妥协。

这里的timing解说不清楚,看References的连接说的比较清楚

在这里插入图片描述
In this view, the “Fatigued” layer is synced with the base layer. The state machine structure is the same as the base layer, and the individual animations used within each state are swapped for different but appropriate equivalent animations.

在此视图中,“(Fatigued)疲劳”层与base layer基础层同步。状态机结构与base layer基础层相同,在每个状态中使用的各个动画被换过不同但适当的等效动画。

An ‘S’ is symbol is visible in the Layers sidebar to indicate the layer is a synced layer.

层侧边栏中可见“S”表示层是同步层。

总结

该功能总体与Animator Override Controller是很像,但比Animator Override Controller 又多了一个Timing的功能

根据上面那个Animator状态机的总结

可以控制Fatigued层的Weight值来实现:游戏中,如果一个角色的血残时,将Fatigued层的Weight增加,那么久可以看到角色会有血残值慢慢过渡的效果,会让玩家感受更为真实。

Fatigued层的Weight根据血量20%~90%来映射到Weight的1.0~0.0就可以实现了

References

https://www.bbsmax.com/A/nAJvYoGwzr/
该博文有对sync, timing有更好的说明

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值