class_animationnodestatemachinetransition.rst 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the AnimationNodeStateMachineTransition.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_AnimationNodeStateMachineTransition:
  6. AnimationNodeStateMachineTransition
  7. ===================================
  8. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  9. Tutorials
  10. ---------
  11. - :doc:`AnimationTree <../tutorials/animation/animation_tree>`
  12. Properties
  13. ----------
  14. +------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
  15. | :ref:`StringName<class_StringName>` | :ref:`advance_condition<class_AnimationNodeStateMachineTransition_property_advance_condition>` | ``&""`` |
  16. +------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
  17. | :ref:`bool<class_bool>` | :ref:`auto_advance<class_AnimationNodeStateMachineTransition_property_auto_advance>` | ``false`` |
  18. +------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
  19. | :ref:`bool<class_bool>` | :ref:`disabled<class_AnimationNodeStateMachineTransition_property_disabled>` | ``false`` |
  20. +------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
  21. | :ref:`int<class_int>` | :ref:`priority<class_AnimationNodeStateMachineTransition_property_priority>` | ``1`` |
  22. +------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
  23. | :ref:`SwitchMode<enum_AnimationNodeStateMachineTransition_SwitchMode>` | :ref:`switch_mode<class_AnimationNodeStateMachineTransition_property_switch_mode>` | ``0`` |
  24. +------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
  25. | :ref:`float<class_float>` | :ref:`xfade_time<class_AnimationNodeStateMachineTransition_property_xfade_time>` | ``0.0`` |
  26. +------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+
  27. Signals
  28. -------
  29. .. _class_AnimationNodeStateMachineTransition_signal_advance_condition_changed:
  30. - **advance_condition_changed** **(** **)**
  31. Emitted when :ref:`advance_condition<class_AnimationNodeStateMachineTransition_property_advance_condition>` is changed.
  32. Enumerations
  33. ------------
  34. .. _enum_AnimationNodeStateMachineTransition_SwitchMode:
  35. .. _class_AnimationNodeStateMachineTransition_constant_SWITCH_MODE_IMMEDIATE:
  36. .. _class_AnimationNodeStateMachineTransition_constant_SWITCH_MODE_SYNC:
  37. .. _class_AnimationNodeStateMachineTransition_constant_SWITCH_MODE_AT_END:
  38. enum **SwitchMode**:
  39. - **SWITCH_MODE_IMMEDIATE** = **0** --- Switch to the next state immediately. The current state will end and blend into the beginning of the new one.
  40. - **SWITCH_MODE_SYNC** = **1** --- Switch to the next state immediately, but will seek the new state to the playback position of the old state.
  41. - **SWITCH_MODE_AT_END** = **2** --- Wait for the current state playback to end, then switch to the beginning of the next state animation.
  42. Property Descriptions
  43. ---------------------
  44. .. _class_AnimationNodeStateMachineTransition_property_advance_condition:
  45. - :ref:`StringName<class_StringName>` **advance_condition**
  46. +-----------+------------------------------+
  47. | *Default* | ``&""`` |
  48. +-----------+------------------------------+
  49. | *Setter* | set_advance_condition(value) |
  50. +-----------+------------------------------+
  51. | *Getter* | get_advance_condition() |
  52. +-----------+------------------------------+
  53. Turn on auto advance when this condition is set. The provided name will become a boolean parameter on the :ref:`AnimationTree<class_AnimationTree>` that can be controlled from code (see `#controlling-from-code <../tutorials/animation/animation_tree.html#controlling-from-code>`__ in :doc:`../tutorials/animation/animation_tree`). For example, if :ref:`AnimationTree.tree_root<class_AnimationTree_property_tree_root>` is an :ref:`AnimationNodeStateMachine<class_AnimationNodeStateMachine>` and :ref:`advance_condition<class_AnimationNodeStateMachineTransition_property_advance_condition>` is set to ``"idle"``:
  54. .. tabs::
  55. .. code-tab:: gdscript
  56. $animation_tree.set("parameters/conditions/idle", is_on_floor and (linear_velocity.x == 0))
  57. .. code-tab:: csharp
  58. GetNode<AnimationTree>("animation_tree").Set("parameters/conditions/idle", IsOnFloor && (LinearVelocity.x == 0));
  59. ----
  60. .. _class_AnimationNodeStateMachineTransition_property_auto_advance:
  61. - :ref:`bool<class_bool>` **auto_advance**
  62. +-----------+-------------------------+
  63. | *Default* | ``false`` |
  64. +-----------+-------------------------+
  65. | *Setter* | set_auto_advance(value) |
  66. +-----------+-------------------------+
  67. | *Getter* | has_auto_advance() |
  68. +-----------+-------------------------+
  69. Turn on the transition automatically when this state is reached. This works best with :ref:`SWITCH_MODE_AT_END<class_AnimationNodeStateMachineTransition_constant_SWITCH_MODE_AT_END>`.
  70. ----
  71. .. _class_AnimationNodeStateMachineTransition_property_disabled:
  72. - :ref:`bool<class_bool>` **disabled**
  73. +-----------+---------------------+
  74. | *Default* | ``false`` |
  75. +-----------+---------------------+
  76. | *Setter* | set_disabled(value) |
  77. +-----------+---------------------+
  78. | *Getter* | is_disabled() |
  79. +-----------+---------------------+
  80. Don't use this transition during :ref:`AnimationNodeStateMachinePlayback.travel<class_AnimationNodeStateMachinePlayback_method_travel>` or :ref:`auto_advance<class_AnimationNodeStateMachineTransition_property_auto_advance>`.
  81. ----
  82. .. _class_AnimationNodeStateMachineTransition_property_priority:
  83. - :ref:`int<class_int>` **priority**
  84. +-----------+---------------------+
  85. | *Default* | ``1`` |
  86. +-----------+---------------------+
  87. | *Setter* | set_priority(value) |
  88. +-----------+---------------------+
  89. | *Getter* | get_priority() |
  90. +-----------+---------------------+
  91. Lower priority transitions are preferred when travelling through the tree via :ref:`AnimationNodeStateMachinePlayback.travel<class_AnimationNodeStateMachinePlayback_method_travel>` or :ref:`auto_advance<class_AnimationNodeStateMachineTransition_property_auto_advance>`.
  92. ----
  93. .. _class_AnimationNodeStateMachineTransition_property_switch_mode:
  94. - :ref:`SwitchMode<enum_AnimationNodeStateMachineTransition_SwitchMode>` **switch_mode**
  95. +-----------+------------------------+
  96. | *Default* | ``0`` |
  97. +-----------+------------------------+
  98. | *Setter* | set_switch_mode(value) |
  99. +-----------+------------------------+
  100. | *Getter* | get_switch_mode() |
  101. +-----------+------------------------+
  102. The transition type.
  103. ----
  104. .. _class_AnimationNodeStateMachineTransition_property_xfade_time:
  105. - :ref:`float<class_float>` **xfade_time**
  106. +-----------+-----------------------+
  107. | *Default* | ``0.0`` |
  108. +-----------+-----------------------+
  109. | *Setter* | set_xfade_time(value) |
  110. +-----------+-----------------------+
  111. | *Getter* | get_xfade_time() |
  112. +-----------+-----------------------+
  113. The time to cross-fade between this state and the next.
  114. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  115. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  116. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  117. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  118. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  119. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`