AnimationNodeStateMachinePlayback
继承: Resource
< RefCounted
< Object
Provides playback control for an AnimationNodeStateMachine
.
描述
Allows control of AnimationTree
state machines created with AnimationNodeStateMachine
. Retrieve with $AnimationTree.get("parameters/playback")
.
var state_machine = $AnimationTree.get("parameters/playback")
state_machine.travel("some_state")
var stateMachine = GetNode<AnimationTree>("AnimationTree").Get("parameters/playback").As<AnimationNodeStateMachinePlayback>();
stateMachine.Travel("some_state");
属性
bool | resource_local_to_scene |
方法
float | get_current_length ( ) const1 |
StringName | get_current_node ( ) const1 |
float | get_current_play_position ( ) const1 |
StringName | get_fading_from_node ( ) const1 |
Array StringName | get_travel_path ( ) const1 |
bool | is_playing ( ) const1 |
void | next ( ) |
void | start ( node: StringName , reset: bool = true ) |
void | stop ( ) |
void | travel ( to_node: StringName , reset_on_teleport: bool = true ) |
方法说明
float
get_current_length ( ) const1
Returns the current state length.
Note: It is possible that any AnimationRootNode
can be nodes as well as animations. This means that there can be multiple animations within a single state. Which animation length has priority depends on the nodes connected inside it. Also, if a transition does not reset, the remaining length at that point will be returned.
StringName
get_current_node ( ) const1
Returns the currently playing animation state.
Note: When using a cross-fade, the current state changes to the next state immediately after the cross-fade begins.
float
get_current_play_position ( ) const1
Returns the playback position within the current animation state.
StringName
get_fading_from_node ( ) const1
Returns the starting state of currently fading animation.
Array StringName
get_travel_path ( ) const1
Returns the current travel path as computed internally by the A* algorithm.
Returns true
if an animation is playing.
void
next ( )
If there is a next path by travel or auto advance, immediately transitions from the current state to the next state.
void
start ( node: StringName
, reset: bool
= true )
Starts playing the given animation.
If reset
is true
, the animation is played from the beginning.
void
stop ( )
Stops the currently playing animation.
void
travel ( to_node: StringName
, reset_on_teleport: bool
= true )
Transitions from the current state to another one, following the shortest path.
If the path does not connect from the current state, the animation will play after the state teleports.
If reset_on_teleport
is true
, the animation is played from the beginning when the travel cause a teleportation.
本方法通常需要用户覆盖才能生效。
本方法无副作用,不会修改该实例的任何成员变量。
本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。
本方法用于构造某个类型。
调用本方法无需实例,可直接使用类名进行调用。
本方法描述的是使用本类型作为左操作数的有效运算符。
这个值是由下列位标志构成位掩码的整数。
无返回值。