mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2026-01-04 10:09:56 +03:00
268 lines
15 KiB
ReStructuredText
268 lines
15 KiB
ReStructuredText
:github_url: hide
|
||
|
||
.. _class_AnimationNodeTransition:
|
||
|
||
AnimationNodeTransition
|
||
=======================
|
||
|
||
**Успадковує:** :ref:`AnimationNodeSync<class_AnimationNodeSync>` **<** :ref:`AnimationNode<class_AnimationNode>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
|
||
|
||
Перехід у :ref:`AnimationTree<class_AnimationTree>`, що з’єднує два :ref:`AnimationNode<class_AnimationNode>`.
|
||
|
||
.. rst-class:: classref-introduction-group
|
||
|
||
Опис
|
||
--------
|
||
|
||
Простий кінцевий автомат для випадків, які не вимагають більш просунутого :ref:`AnimationNodeStateMachine<class_AnimationNodeStateMachine>`. До входів можна підключити анімацію та вказати час переходу.
|
||
|
||
Після встановлення запиту та зміни відтворення анімації вузол переходу автоматично очищає запит у наступному кадрі процесу, встановлюючи значення ``transition_request`` порожнім.
|
||
|
||
\ **Примітка.** Під час використання крос-фейду ``current_state`` і ``current_index`` змінюються на наступний стан одразу після початку крос-фейду.
|
||
|
||
|
||
.. tabs::
|
||
|
||
.. code-tab:: gdscript
|
||
|
||
# Відтворення дочірньої анімації, підключеної до порту "state_2".
|
||
animation_tree.set("parameters/Transition/transition_request", "state_2")
|
||
# Альтернативний синтаксис (той самий результат, що й вище).
|
||
animation_tree["parameters/Transition/transition_request"] = "state_2"
|
||
|
||
# Отримати назву поточного стану (тільки для читання).
|
||
animation_tree.get("parameters/Transition/current_state")
|
||
# Альтернативний синтаксис (той самий результат, що й вище).
|
||
animation_tree["parameters/Transition/current_state"]
|
||
|
||
# Отримати індекс поточного стану (тільки для читання).
|
||
animation_tree.get("parameters/Transition/current_index")
|
||
# Альтернативний синтаксис (той самий результат, що й вище).
|
||
animation_tree["parameters/Transition/current_index"]
|
||
|
||
.. code-tab:: csharp
|
||
|
||
// Відтворення дочірньої анімації, підключеної до порту "state_2".
|
||
animationTree.Set("parameters/Transition/transition_request", "state_2");
|
||
|
||
// Отримати назву поточного стану (тільки для читання).
|
||
animationTree.Get("parameters/Transition/current_state");
|
||
|
||
// Отримати індекс поточного стану (тільки для читання).
|
||
animationTree.Get("parameters/Transition/current_index");
|
||
|
||
|
||
|
||
.. rst-class:: classref-introduction-group
|
||
|
||
Посібники
|
||
------------------
|
||
|
||
- :doc:`Використання Дерева анімації <../tutorials/animation/animation_tree>`
|
||
|
||
- `Демонстрація 3D-платформера <https://godotengine.org/asset-library/asset/2748>`__
|
||
|
||
- `Демо-версія шутера від третьої особи (TPS) <https://godotengine.org/asset-library/asset/2710>`__
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
Властивості
|
||
----------------------
|
||
|
||
.. table::
|
||
:widths: auto
|
||
|
||
+---------------------------+--------------------------------------------------------------------------------------------------+-----------+
|
||
| :ref:`bool<class_bool>` | :ref:`allow_transition_to_self<class_AnimationNodeTransition_property_allow_transition_to_self>` | ``false`` |
|
||
+---------------------------+--------------------------------------------------------------------------------------------------+-----------+
|
||
| :ref:`int<class_int>` | :ref:`input_count<class_AnimationNodeTransition_property_input_count>` | ``0`` |
|
||
+---------------------------+--------------------------------------------------------------------------------------------------+-----------+
|
||
| :ref:`Curve<class_Curve>` | :ref:`xfade_curve<class_AnimationNodeTransition_property_xfade_curve>` | |
|
||
+---------------------------+--------------------------------------------------------------------------------------------------+-----------+
|
||
| :ref:`float<class_float>` | :ref:`xfade_time<class_AnimationNodeTransition_property_xfade_time>` | ``0.0`` |
|
||
+---------------------------+--------------------------------------------------------------------------------------------------+-----------+
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
Методи
|
||
------------
|
||
|
||
.. table::
|
||
:widths: auto
|
||
|
||
+-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_input_loop_broken_at_end<class_AnimationNodeTransition_method_is_input_loop_broken_at_end>`\ (\ input\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_input_reset<class_AnimationNodeTransition_method_is_input_reset>`\ (\ input\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_input_set_as_auto_advance<class_AnimationNodeTransition_method_is_input_set_as_auto_advance>`\ (\ input\: :ref:`int<class_int>`\ ) |const| |
|
||
+-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_input_as_auto_advance<class_AnimationNodeTransition_method_set_input_as_auto_advance>`\ (\ input\: :ref:`int<class_int>`, enable\: :ref:`bool<class_bool>`\ ) |
|
||
+-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_input_break_loop_at_end<class_AnimationNodeTransition_method_set_input_break_loop_at_end>`\ (\ input\: :ref:`int<class_int>`, enable\: :ref:`bool<class_bool>`\ ) |
|
||
+-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_input_reset<class_AnimationNodeTransition_method_set_input_reset>`\ (\ input\: :ref:`int<class_int>`, enable\: :ref:`bool<class_bool>`\ ) |
|
||
+-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
Описи властивостей
|
||
------------------------------------
|
||
|
||
.. _class_AnimationNodeTransition_property_allow_transition_to_self:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **allow_transition_to_self** = ``false`` :ref:`🔗<class_AnimationNodeTransition_property_allow_transition_to_self>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_allow_transition_to_self**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_allow_transition_to_self**\ (\ )
|
||
|
||
Якщо ``true``, дозволяє перехід до власного стану. Коли параметр скидання ввімкнено у вхідних даних, анімація запускається заново. Якщо ``false``, нічого не відбувається під час переходу до власного стану.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_AnimationNodeTransition_property_input_count:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`int<class_int>` **input_count** = ``0`` :ref:`🔗<class_AnimationNodeTransition_property_input_count>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_input_count**\ (\ value\: :ref:`int<class_int>`\ )
|
||
- :ref:`int<class_int>` **get_input_count**\ (\ )
|
||
|
||
Кількість увімкнених портів введення для цього вузла анімації.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_AnimationNodeTransition_property_xfade_curve:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`Curve<class_Curve>` **xfade_curve** :ref:`🔗<class_AnimationNodeTransition_property_xfade_curve>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_xfade_curve**\ (\ value\: :ref:`Curve<class_Curve>`\ )
|
||
- :ref:`Curve<class_Curve>` **get_xfade_curve**\ (\ )
|
||
|
||
Визначає, як зменшується перехресне затухання між анімаціями. Якщо пусте, перехід буде лінійним. Має бути одиницею :ref:`Curve<class_Curve>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_AnimationNodeTransition_property_xfade_time:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`float<class_float>` **xfade_time** = ``0.0`` :ref:`🔗<class_AnimationNodeTransition_property_xfade_time>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_xfade_time**\ (\ value\: :ref:`float<class_float>`\ )
|
||
- :ref:`float<class_float>` **get_xfade_time**\ (\ )
|
||
|
||
Час переходу (в секундах) між кожною анімацією, підключеною до входів.
|
||
|
||
\ **Примітка: ** **AnimationNodeTransition** переносить поточний стан відразу після початку затухання. Точний час, що залишився, можна визначити лише за основною анімацією. Коли :ref:`AnimationNodeOutput<class_AnimationNodeOutput>` вважається найвищим потоком, тому :ref:`xfade_time<class_AnimationNodeTransition_property_xfade_time>` не масштабується залежно від дельти низхідного потоку. Дивіться також :ref:`AnimationNodeOneShot.fadeout_time<class_AnimationNodeOneShot_property_fadeout_time>`.
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
Описи методів
|
||
--------------------------
|
||
|
||
.. _class_AnimationNodeTransition_method_is_input_loop_broken_at_end:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_input_loop_broken_at_end**\ (\ input\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_AnimationNodeTransition_method_is_input_loop_broken_at_end>`
|
||
|
||
Повертає, чи анімація розриває цикл у кінці циклу цикла для переходу.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_AnimationNodeTransition_method_is_input_reset:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_input_reset**\ (\ input\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_AnimationNodeTransition_method_is_input_reset>`
|
||
|
||
Повертає, чи перезапускається анімація при переході з іншої анімації.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_AnimationNodeTransition_method_is_input_set_as_auto_advance:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_input_set_as_auto_advance**\ (\ input\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_AnimationNodeTransition_method_is_input_set_as_auto_advance>`
|
||
|
||
Повертає ``true``, якщо для заданого індексу ``input`` увімкнено авто-перехід.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_AnimationNodeTransition_method_set_input_as_auto_advance:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_input_as_auto_advance**\ (\ input\: :ref:`int<class_int>`, enable\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_AnimationNodeTransition_method_set_input_as_auto_advance>`
|
||
|
||
Вмикає або вимикає автоперехід для заданого індексу ``input``. Якщо увімкнено, стан змінюється на наступний після відтворення анімації. Якщо увімкнено для останнього стану входу, то відбувається циклічний перехід до першого.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_AnimationNodeTransition_method_set_input_break_loop_at_end:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_input_break_loop_at_end**\ (\ input\: :ref:`int<class_int>`, enable\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_AnimationNodeTransition_method_set_input_break_loop_at_end>`
|
||
|
||
Якщо ``true``, розриває цикл у кінці циклу цикла для переходу, навіть якщо анімація повторюється.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_AnimationNodeTransition_method_set_input_reset:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_input_reset**\ (\ input\: :ref:`int<class_int>`, enable\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_AnimationNodeTransition_method_set_input_reset>`
|
||
|
||
Якщо ``true``, цільова анімація перезапускається під час переходу анімації.
|
||
|
||
.. |virtual| replace:: :abbr:`virtual (Зазвичай, цей метод перевизначається користувачем, щоб він мав вплив.)`
|
||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||
.. |const| replace:: :abbr:`const (Цей метод не має побічних ефектів. Не змінює ніяку змінну екземпляра об'єкта.)`
|
||
.. |vararg| replace:: :abbr:`vararg (Цей метод приймає будь-яке число аргументів після описаних тут.)`
|
||
.. |constructor| replace:: :abbr:`constructor (Цей метод використовується для побудови типів.)`
|
||
.. |static| replace:: :abbr:`static (Цей метод не потребує екземпляра для виклику, його можна викликати безпосередньо за допомогою назви класу.)`
|
||
.. |operator| replace:: :abbr:`operator (Цей метод описує дійсний оператор для взаємодії з цим типом як з лівим операндом.)`
|
||
.. |bitfield| replace:: :abbr:`BitField (Це значення є цілим числом, складеним у вигляді бітової маски з наступних прапорів.)`
|
||
.. |void| replace:: :abbr:`void (Значення не повертається.)`
|