Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

AnimationNodeTransition

Успадковує: AnimationNodeSync < AnimationNode < Resource < RefCounted < Object

Перехід у AnimationTree, що з’єднує два AnimationNode.

Опис

Simple state machine for cases which don't require a more advanced AnimationNodeStateMachine. Animations can be connected to the inputs and transition times can be specified.

After setting the request and changing the animation playback, the transition node automatically clears the request on the next process frame by setting its transition_request value to empty.

Note: When using a cross-fade, current_state and current_index change to the next state immediately after the cross-fade begins.

# Play child animation connected to "state_2" port.
animation_tree.set("parameters/Transition/transition_request", "state_2")
# Alternative syntax (same result as above).
animation_tree["parameters/Transition/transition_request"] = "state_2"

# Get current state name (read-only).
animation_tree.get("parameters/Transition/current_state")
# Alternative syntax (same result as above).
animation_tree["parameters/Transition/current_state"]

# Get current state index (read-only).
animation_tree.get("parameters/Transition/current_index")
# Alternative syntax (same result as above).
animation_tree["parameters/Transition/current_index"]

Optionally, signals can be used by setting an AnimationNodeObserverTransition through AnimationTree.

var observer = animation_tree.get("parameters/Transition/observer")
observer.state_started.connect(on_state_started)

Посібники

Властивості

bool

allow_transition_to_self

false

int

input_count

0

Curve

xfade_curve

float

xfade_time

0.0

Методи

bool

is_input_loop_broken_at_end(input: int) const

bool

is_input_reset(input: int) const

bool

is_input_set_as_auto_advance(input: int) const

void

set_input_as_auto_advance(input: int, enable: bool)

void

set_input_break_loop_at_end(input: int, enable: bool)

void

set_input_reset(input: int, enable: bool)


Описи властивостей

bool allow_transition_to_self = false 🔗

  • void set_allow_transition_to_self(value: bool)

  • bool is_allow_transition_to_self()

Якщо true, дозволяє перехід до власного стану. Коли параметр скидання ввімкнено у вхідних даних, анімація запускається заново. Якщо false, нічого не відбувається під час переходу до власного стану.


int input_count = 0 🔗

  • void set_input_count(value: int)

  • int get_input_count()

Кількість увімкнених портів введення для цього вузла анімації.


Curve xfade_curve 🔗

  • void set_xfade_curve(value: Curve)

  • Curve get_xfade_curve()

Визначає, як зменшується перехресне затухання між анімаціями. Якщо пусте, перехід буде лінійним. Має бути одиницею Curve.


float xfade_time = 0.0 🔗

  • void set_xfade_time(value: float)

  • float get_xfade_time()

Час переходу (в секундах) між кожною анімацією, підключеною до входів.

Примітка: ** **AnimationNodeTransition переносить поточний стан відразу після початку затухання. Точний час, що залишився, можна визначити лише за основною анімацією. Коли AnimationNodeOutput вважається найвищим потоком, тому xfade_time не масштабується залежно від дельти низхідного потоку. Дивіться також AnimationNodeOneShot.fadeout_time.


Описи методів

bool is_input_loop_broken_at_end(input: int) const 🔗

Повертає, чи анімація розриває цикл у кінці циклу цикла для переходу.


bool is_input_reset(input: int) const 🔗

Повертає, чи перезапускається анімація при переході з іншої анімації.


bool is_input_set_as_auto_advance(input: int) const 🔗

Повертає true, якщо для заданого індексу input увімкнено авто-перехід.


void set_input_as_auto_advance(input: int, enable: bool) 🔗

Вмикає або вимикає автоперехід для заданого індексу input. Якщо увімкнено, стан змінюється на наступний після відтворення анімації. Якщо увімкнено для останнього стану входу, то відбувається циклічний перехід до першого.


void set_input_break_loop_at_end(input: int, enable: bool) 🔗

Якщо true, розриває цикл у кінці циклу цикла для переходу, навіть якщо анімація повторюється.


void set_input_reset(input: int, enable: bool) 🔗

Якщо true, цільова анімація перезапускається під час переходу анімації.