天天看点

[译文] Unity - Mecanim Transition's HasExitTime 会改变Transition的时机References

References

原文

原文部分引用

Conditions

A transition can have a single condition, multiple conditions, or no conditions at all. If your transition has no conditions, the Unity Editor only considers the Exit Time, and the transition occurs when the exit time is reached. If your transition has one or more conditions, the conditions must all be met before the transition is triggered.

A condition consists of:

  • An event parameter, the value of which is considered in the condition.
  • A conditional predicate, if needed (for example, less or greater for floats).
  • A parameter value, if needed.
If Has Exit Time is enabled for the transition and has one or more conditions, these conditions are only checked after the exit time of the state. This allows you to ensure that your transition only occurs during a certain portion of the animation.

译文

条件(Conditions)

一个转换可以有一个条件、多个条件,或者根本没有条件。如果您的转换没有任何条件,那么Unity编辑器只考虑退出时间(Exit Time,英文中没说明一点,如果没有Condition的Transition的话,你想要Exit Time是触发,那HasExitTime一定要勾上,不然就没有效果了),当到达退出时间(Exit Time)时就会发生转换。如果转换具有一个或多个条件,则在触发转换之前必须满足所有条件。

条件包括:

  • 参数
  • 判断逻辑
  • 或是判断值,如果需要的话
如果为转换启用了has exit time并且具有一个或多个条件,则仅在状态的退出时间(Exit Time)之后检查这些条件。这允许您确保仅在动画的某个部分发生转换。