AnimationNodeStateMachineTransition

继承: Resource < RefCounted < Object

A transition within an AnimationNodeStateMachine connecting two AnimationRootNode s.

描述

The path generated when using AnimationNodeStateMachinePlayback.travel is limited to the nodes connected by AnimationNodeStateMachineTransition.

You can set the timing and conditions of the transition in detail.

属性


信号

advance_condition_changed ( )

Emitted when advance_condition is changed.


枚举

enum SwitchMode:

SwitchMode SWITCH_MODE_IMMEDIATE = 0

Switch to the next state immediately. The current state will end and blend into the beginning of the new one.

SwitchMode SWITCH_MODE_SYNC = 1

Switch to the next state immediately, but will seek the new state to the playback position of the old state.

SwitchMode SWITCH_MODE_AT_END = 2

Wait for the current state playback to end, then switch to the beginning of the next state animation.


enum AdvanceMode:

AdvanceMode ADVANCE_MODE_DISABLED = 0

Don't use this transition.

AdvanceMode ADVANCE_MODE_ENABLED = 1

Only use this transition during AnimationNodeStateMachinePlayback.travel.

AdvanceMode ADVANCE_MODE_AUTO = 2

Automatically use this transition if the advance_condition and advance_expression checks are true (if assigned).


属性说明

StringName advance_condition = &""

Turn on auto advance when this condition is set. The provided name will become a boolean parameter on the AnimationTree that can be controlled from code (see Using AnimationTree). For example, if AnimationTree.tree_root is an AnimationNodeStateMachine and advance_condition is set to "idle":


    $animation_tree.set("parameters/conditions/idle", is_on_floor and (linear_velocity.x == 0))

    GetNode<AnimationTree>("animation_tree").Set("parameters/conditions/idle", IsOnFloor && (LinearVelocity.X == 0));

String advance_expression = ""

  • void set_advance_expression ( value: String )
  • String get_advance_expression ( )

Use an expression as a condition for state machine transitions. It is possible to create complex animation advance conditions for switching between states and gives much greater flexibility for creating complex state machines by directly interfacing with the script code.


AdvanceMode advance_mode = 1

Determines whether the transition should disabled, enabled when using AnimationNodeStateMachinePlayback.travel, or traversed automatically if the advance_condition and advance_expression checks are true (if assigned).


bool break_loop_at_end = false

  • void set_break_loop_at_end ( value: bool )
  • bool is_loop_broken_at_end ( )

If true, breaks the loop at the end of the loop cycle for transition, even if the animation is looping.


int priority = 1

  • void set_priority ( value: int )
  • int get_priority ( )

Lower priority transitions are preferred when travelling through the tree via AnimationNodeStateMachinePlayback.travel or advance_mode is set to ADVANCE_MODE_AUTO.


bool reset = true

  • void set_reset ( value: bool )
  • bool is_reset ( )

If true, the destination animation is played back from the beginning when switched.


SwitchMode switch_mode = 0

The transition type.


Curve xfade_curve

  • void set_xfade_curve ( value: Curve )
  • Curve get_xfade_curve ( )

Ease curve for better control over cross-fade between this state and the next.


float xfade_time = 0.0

  • void set_xfade_time ( value: float )
  • float get_xfade_time ( )

The time to cross-fade between this state and the next.

Note: AnimationNodeStateMachine transitions the current state immediately after the start of the fading. The precise remaining time can only be inferred from the main animation. When AnimationNodeOutput is considered as the most upstream, so the xfade_time is not scaled depending on the downstream delta. See also AnimationNodeOneShot.fadeout_time.

1

本方法通常需要用户覆盖才能生效。

2

本方法无副作用,不会修改该实例的任何成员变量。

3

本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。

4

本方法用于构造某个类型。

5

调用本方法无需实例,可直接使用类名进行调用。

6

本方法描述的是使用本类型作为左操作数的有效运算符。

7

这个值是由下列位标志构成位掩码的整数。

8

无返回值。