天天看點

[譯文] 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)之後檢查這些條件。這允許您確定僅在動畫的某個部分發生轉換。