mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2025-12-31 09:49:22 +03:00
249 lines
14 KiB
ReStructuredText
249 lines
14 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. _class_SkeletonModificationStack2D:
|
|
|
|
SkeletonModificationStack2D
|
|
===========================
|
|
|
|
**實驗性:** This class may be changed or removed in future versions.
|
|
|
|
**繼承:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
|
|
|
|
存放 :ref:`SkeletonModification2D<class_SkeletonModification2D>` 堆疊的資源。
|
|
|
|
.. rst-class:: classref-introduction-group
|
|
|
|
說明
|
|
----
|
|
|
|
該資源由 Skeleton 使用,並持有一個 :ref:`SkeletonModification2D<class_SkeletonModification2D>` 堆疊。
|
|
|
|
這控制了修改的順序以及它們的套用方式。修改順序對於全身 IK 設定尤為重要,因為需要以正確的循序執行修改以獲得所需的結果。例如,想在人形骨骼的手臂\ *之前*\ 對脊柱執行一個修改。
|
|
|
|
該資源還控制所有修改被套用於 :ref:`Skeleton2D<class_Skeleton2D>` 的強度。
|
|
|
|
.. rst-class:: classref-reftable-group
|
|
|
|
屬性
|
|
----
|
|
|
|
.. table::
|
|
:widths: auto
|
|
|
|
+---------------------------+------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`bool<class_bool>` | :ref:`enabled<class_SkeletonModificationStack2D_property_enabled>` | ``false`` |
|
|
+---------------------------+------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`int<class_int>` | :ref:`modification_count<class_SkeletonModificationStack2D_property_modification_count>` | ``0`` |
|
|
+---------------------------+------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`float<class_float>` | :ref:`strength<class_SkeletonModificationStack2D_property_strength>` | ``1.0`` |
|
|
+---------------------------+------------------------------------------------------------------------------------------+-----------+
|
|
|
|
.. rst-class:: classref-reftable-group
|
|
|
|
方法
|
|
----
|
|
|
|
.. table::
|
|
:widths: auto
|
|
|
|
+-------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`add_modification<class_SkeletonModificationStack2D_method_add_modification>`\ (\ modification\: :ref:`SkeletonModification2D<class_SkeletonModification2D>`\ ) |
|
|
+-------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`delete_modification<class_SkeletonModificationStack2D_method_delete_modification>`\ (\ mod_idx\: :ref:`int<class_int>`\ ) |
|
|
+-------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`enable_all_modifications<class_SkeletonModificationStack2D_method_enable_all_modifications>`\ (\ enabled\: :ref:`bool<class_bool>`\ ) |
|
|
+-------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`execute<class_SkeletonModificationStack2D_method_execute>`\ (\ delta\: :ref:`float<class_float>`, execution_mode\: :ref:`int<class_int>`\ ) |
|
|
+-------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`get_is_setup<class_SkeletonModificationStack2D_method_get_is_setup>`\ (\ ) |const| |
|
|
+-------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`SkeletonModification2D<class_SkeletonModification2D>` | :ref:`get_modification<class_SkeletonModificationStack2D_method_get_modification>`\ (\ mod_idx\: :ref:`int<class_int>`\ ) |const| |
|
|
+-------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Skeleton2D<class_Skeleton2D>` | :ref:`get_skeleton<class_SkeletonModificationStack2D_method_get_skeleton>`\ (\ ) |const| |
|
|
+-------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`set_modification<class_SkeletonModificationStack2D_method_set_modification>`\ (\ mod_idx\: :ref:`int<class_int>`, modification\: :ref:`SkeletonModification2D<class_SkeletonModification2D>`\ ) |
|
|
+-------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`setup<class_SkeletonModificationStack2D_method_setup>`\ (\ ) |
|
|
+-------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
屬性說明
|
|
--------
|
|
|
|
.. _class_SkeletonModificationStack2D_property_enabled:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`bool<class_bool>` **enabled** = ``false`` :ref:`🔗<class_SkeletonModificationStack2D_property_enabled>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
|
|
- :ref:`bool<class_bool>` **get_enabled**\ (\ )
|
|
|
|
如果為 ``true``\ ,則會呼叫該堆疊中的修改器。這是通過 :ref:`Skeleton2D<class_Skeleton2D>` 節點自動處理的。
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SkeletonModificationStack2D_property_modification_count:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`int<class_int>` **modification_count** = ``0`` :ref:`🔗<class_SkeletonModificationStack2D_property_modification_count>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_modification_count**\ (\ value\: :ref:`int<class_int>`\ )
|
|
- :ref:`int<class_int>` **get_modification_count**\ (\ )
|
|
|
|
堆疊中修改器的數量。
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SkeletonModificationStack2D_property_strength:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`float<class_float>` **strength** = ``1.0`` :ref:`🔗<class_SkeletonModificationStack2D_property_strength>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_strength**\ (\ value\: :ref:`float<class_float>`\ )
|
|
- :ref:`float<class_float>` **get_strength**\ (\ )
|
|
|
|
堆疊中修改的插值強度。\ ``0`` 的值將使修改不被套用,\ ``0.5`` 的強度將套用一半,\ ``1`` 的強度將允許修改被完全套用並覆蓋 :ref:`Skeleton2D<class_Skeleton2D>` :ref:`Bone2D<class_Bone2D>` 姿勢。
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
方法說明
|
|
--------
|
|
|
|
.. _class_SkeletonModificationStack2D_method_add_modification:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **add_modification**\ (\ modification\: :ref:`SkeletonModification2D<class_SkeletonModification2D>`\ ) :ref:`🔗<class_SkeletonModificationStack2D_method_add_modification>`
|
|
|
|
將傳入的 :ref:`SkeletonModification2D<class_SkeletonModification2D>` 入堆疊。
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SkeletonModificationStack2D_method_delete_modification:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **delete_modification**\ (\ mod_idx\: :ref:`int<class_int>`\ ) :ref:`🔗<class_SkeletonModificationStack2D_method_delete_modification>`
|
|
|
|
如果存在,則刪除位於索引位置 ``mod_idx`` 的 :ref:`SkeletonModification2D<class_SkeletonModification2D>`\ 。
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SkeletonModificationStack2D_method_enable_all_modifications:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **enable_all_modifications**\ (\ enabled\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_SkeletonModificationStack2D_method_enable_all_modifications>`
|
|
|
|
啟用堆疊中的所有 :ref:`SkeletonModification2D<class_SkeletonModification2D>`\ 。
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SkeletonModificationStack2D_method_execute:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **execute**\ (\ delta\: :ref:`float<class_float>`, execution_mode\: :ref:`int<class_int>`\ ) :ref:`🔗<class_SkeletonModificationStack2D_method_execute>`
|
|
|
|
使用傳入的執行模式 ``execution_mode`` 執行堆疊中的所有 :ref:`SkeletonModification2D<class_SkeletonModification2D>`\ ,從索引 ``0`` 執行到 :ref:`modification_count<class_SkeletonModificationStack2D_property_modification_count>`\ 。
|
|
|
|
\ **注意:**\ 根據修改器的不同,結果可能會因修改器順序的不同而不同。例如,對脊柱的修改應該在對手臂的修改之前執行,這樣才能得到正確的結果。
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SkeletonModificationStack2D_method_get_is_setup:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`bool<class_bool>` **get_is_setup**\ (\ ) |const| :ref:`🔗<class_SkeletonModificationStack2D_method_get_is_setup>`
|
|
|
|
返回一個布林值,指示該修改堆疊是否已被設定並可以執行。
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SkeletonModificationStack2D_method_get_modification:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`SkeletonModification2D<class_SkeletonModification2D>` **get_modification**\ (\ mod_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_SkeletonModificationStack2D_method_get_modification>`
|
|
|
|
返回傳入索引 ``mod_idx`` 處的 :ref:`SkeletonModification2D<class_SkeletonModification2D>`\ 。
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SkeletonModificationStack2D_method_get_skeleton:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`Skeleton2D<class_Skeleton2D>` **get_skeleton**\ (\ ) |const| :ref:`🔗<class_SkeletonModificationStack2D_method_get_skeleton>`
|
|
|
|
返回 SkeletonModification2D 綁定到的 :ref:`Skeleton2D<class_Skeleton2D>` 節點。
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SkeletonModificationStack2D_method_set_modification:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **set_modification**\ (\ mod_idx\: :ref:`int<class_int>`, modification\: :ref:`SkeletonModification2D<class_SkeletonModification2D>`\ ) :ref:`🔗<class_SkeletonModificationStack2D_method_set_modification>`
|
|
|
|
將位於 ``mod_idx`` 的修改器設定為傳入的 ``modification``\ 。
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_SkeletonModificationStack2D_method_setup:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **setup**\ (\ ) :ref:`🔗<class_SkeletonModificationStack2D_method_setup>`
|
|
|
|
設定該修改堆疊以便它可以執行。該函式應由 :ref:`Skeleton2D<class_Skeleton2D>` 呼叫,除非知道自己在做什麼,否則不應被手動呼叫。
|
|
|
|
.. |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 (無回傳值。)`
|