mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2025-12-31 09:49:22 +03:00
247 lines
11 KiB
ReStructuredText
247 lines
11 KiB
ReStructuredText
:github_url: hide
|
||
|
||
.. _class_AnimationNodeAnimation:
|
||
|
||
AnimationNodeAnimation
|
||
======================
|
||
|
||
**繼承:** :ref:`AnimationRootNode<class_AnimationRootNode>` **<** :ref:`AnimationNode<class_AnimationNode>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
|
||
|
||
:ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>` 的輸入動畫節點。
|
||
|
||
.. rst-class:: classref-introduction-group
|
||
|
||
說明
|
||
----
|
||
|
||
可加入 :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>` 的資源。僅透過 :ref:`animation<class_AnimationNodeAnimation_property_animation>` 作為單一輸出埠,供其他 :ref:`AnimationNode<class_AnimationNode>` 進行動畫混合之輸入使用。
|
||
|
||
.. rst-class:: classref-introduction-group
|
||
|
||
教學
|
||
----
|
||
|
||
- :doc:`使用 AnimationTree <../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:`advance_on_start<class_AnimationNodeAnimation_property_advance_on_start>` | ``false`` |
|
||
+-------------------------------------------------------+---------------------------------------------------------------------------------------+-----------+
|
||
| :ref:`StringName<class_StringName>` | :ref:`animation<class_AnimationNodeAnimation_property_animation>` | ``&""`` |
|
||
+-------------------------------------------------------+---------------------------------------------------------------------------------------+-----------+
|
||
| :ref:`LoopMode<enum_Animation_LoopMode>` | :ref:`loop_mode<class_AnimationNodeAnimation_property_loop_mode>` | |
|
||
+-------------------------------------------------------+---------------------------------------------------------------------------------------+-----------+
|
||
| :ref:`PlayMode<enum_AnimationNodeAnimation_PlayMode>` | :ref:`play_mode<class_AnimationNodeAnimation_property_play_mode>` | ``0`` |
|
||
+-------------------------------------------------------+---------------------------------------------------------------------------------------+-----------+
|
||
| :ref:`float<class_float>` | :ref:`start_offset<class_AnimationNodeAnimation_property_start_offset>` | |
|
||
+-------------------------------------------------------+---------------------------------------------------------------------------------------+-----------+
|
||
| :ref:`bool<class_bool>` | :ref:`stretch_time_scale<class_AnimationNodeAnimation_property_stretch_time_scale>` | |
|
||
+-------------------------------------------------------+---------------------------------------------------------------------------------------+-----------+
|
||
| :ref:`float<class_float>` | :ref:`timeline_length<class_AnimationNodeAnimation_property_timeline_length>` | |
|
||
+-------------------------------------------------------+---------------------------------------------------------------------------------------+-----------+
|
||
| :ref:`bool<class_bool>` | :ref:`use_custom_timeline<class_AnimationNodeAnimation_property_use_custom_timeline>` | ``false`` |
|
||
+-------------------------------------------------------+---------------------------------------------------------------------------------------+-----------+
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
列舉
|
||
----
|
||
|
||
.. _enum_AnimationNodeAnimation_PlayMode:
|
||
|
||
.. rst-class:: classref-enumeration
|
||
|
||
enum **PlayMode**: :ref:`🔗<enum_AnimationNodeAnimation_PlayMode>`
|
||
|
||
.. _class_AnimationNodeAnimation_constant_PLAY_MODE_FORWARD:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PlayMode<enum_AnimationNodeAnimation_PlayMode>` **PLAY_MODE_FORWARD** = ``0``
|
||
|
||
正向播放動畫。
|
||
|
||
.. _class_AnimationNodeAnimation_constant_PLAY_MODE_BACKWARD:
|
||
|
||
.. rst-class:: classref-enumeration-constant
|
||
|
||
:ref:`PlayMode<enum_AnimationNodeAnimation_PlayMode>` **PLAY_MODE_BACKWARD** = ``1``
|
||
|
||
反向播放動畫。
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
屬性說明
|
||
--------
|
||
|
||
.. _class_AnimationNodeAnimation_property_advance_on_start:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **advance_on_start** = ``false`` :ref:`🔗<class_AnimationNodeAnimation_property_advance_on_start>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_advance_on_start**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_advance_on_start**\ (\ )
|
||
|
||
若為 ``true``\ ,當收到自開頭播放動畫的請求時,第一幀僅進行處理但不渲染,播放將自下一幀開始。
|
||
|
||
另請參閱 :ref:`AnimationPlayer.play()<class_AnimationPlayer_method_play>` 的注意事項。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_AnimationNodeAnimation_property_animation:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`StringName<class_StringName>` **animation** = ``&""`` :ref:`🔗<class_AnimationNodeAnimation_property_animation>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_animation**\ (\ value\: :ref:`StringName<class_StringName>`\ )
|
||
- :ref:`StringName<class_StringName>` **get_animation**\ (\ )
|
||
|
||
要輸出的動畫,必須是 :ref:`AnimationTree.anim_player<class_AnimationTree_property_anim_player>` 所提供的動畫之一。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_AnimationNodeAnimation_property_loop_mode:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`LoopMode<enum_Animation_LoopMode>` **loop_mode** :ref:`🔗<class_AnimationNodeAnimation_property_loop_mode>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_loop_mode**\ (\ value\: :ref:`LoopMode<enum_Animation_LoopMode>`\ )
|
||
- :ref:`LoopMode<enum_Animation_LoopMode>` **get_loop_mode**\ (\ )
|
||
|
||
當 :ref:`use_custom_timeline<class_AnimationNodeAnimation_property_use_custom_timeline>` 為 ``true`` 時,會以此值覆寫原始 :ref:`Animation<class_Animation>` 資源的迴圈設定。
|
||
|
||
\ **注意:** 若 :ref:`Animation.loop_mode<class_Animation_property_loop_mode>` 未設為循環,則 :ref:`Animation.track_set_interpolation_loop_wrap()<class_Animation_method_track_set_interpolation_loop_wrap>` 不會生效。若行為不如預期,建議複製該 :ref:`Animation<class_Animation>` 資源並調整其迴圈設定。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_AnimationNodeAnimation_property_play_mode:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`PlayMode<enum_AnimationNodeAnimation_PlayMode>` **play_mode** = ``0`` :ref:`🔗<class_AnimationNodeAnimation_property_play_mode>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_play_mode**\ (\ value\: :ref:`PlayMode<enum_AnimationNodeAnimation_PlayMode>`\ )
|
||
- :ref:`PlayMode<enum_AnimationNodeAnimation_PlayMode>` **get_play_mode**\ (\ )
|
||
|
||
決定動畫的播放方向。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_AnimationNodeAnimation_property_start_offset:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`float<class_float>` **start_offset** :ref:`🔗<class_AnimationNodeAnimation_property_start_offset>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_start_offset**\ (\ value\: :ref:`float<class_float>`\ )
|
||
- :ref:`float<class_float>` **get_start_offset**\ (\ )
|
||
|
||
當 :ref:`use_custom_timeline<class_AnimationNodeAnimation_property_use_custom_timeline>` 為 ``true`` 時,可偏移動畫的起始位置。
|
||
|
||
這對於在 3D 行走動畫中調整先踏出的腳十分有用。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_AnimationNodeAnimation_property_stretch_time_scale:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **stretch_time_scale** :ref:`🔗<class_AnimationNodeAnimation_property_stretch_time_scale>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_stretch_time_scale**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_stretching_time_scale**\ (\ )
|
||
|
||
若為 ``true``\ ,會縮放時間,使 :ref:`timeline_length<class_AnimationNodeAnimation_property_timeline_length>` 所設定的長度成為一個循環。
|
||
|
||
這有助於對齊走路與跑步動畫的週期。
|
||
|
||
若為 ``false``\ ,則使用原始動畫長度。若你啟用 :ref:`loop_mode<class_AnimationNodeAnimation_property_loop_mode>` 迴圈,動畫將於 :ref:`timeline_length<class_AnimationNodeAnimation_property_timeline_length>` 內循環。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_AnimationNodeAnimation_property_timeline_length:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`float<class_float>` **timeline_length** :ref:`🔗<class_AnimationNodeAnimation_property_timeline_length>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_timeline_length**\ (\ value\: :ref:`float<class_float>`\ )
|
||
- :ref:`float<class_float>` **get_timeline_length**\ (\ )
|
||
|
||
當 :ref:`use_custom_timeline<class_AnimationNodeAnimation_property_use_custom_timeline>` 為 ``true`` 時,可偏移動畫的起始位置。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_AnimationNodeAnimation_property_use_custom_timeline:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **use_custom_timeline** = ``false`` :ref:`🔗<class_AnimationNodeAnimation_property_use_custom_timeline>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_use_custom_timeline**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_using_custom_timeline**\ (\ )
|
||
|
||
若為 ``true``\ ,此 :ref:`AnimationNode<class_AnimationNode>` 會輸出以調整部分參數後的 :ref:`Animation<class_Animation>` 資源。
|
||
|
||
.. |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 (無回傳值。)`
|