mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2025-12-31 09:49:22 +03:00
372 lines
16 KiB
ReStructuredText
372 lines
16 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. _class_AnimationNodeOneShot:
|
|
|
|
AnimationNodeOneShot
|
|
====================
|
|
|
|
**Hereda:** :ref:`AnimationNodeSync<class_AnimationNodeSync>` **<** :ref:`AnimationNode<class_AnimationNode>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
|
|
|
|
Reproduce una animación una vez en un :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`.
|
|
|
|
.. rst-class:: classref-introduction-group
|
|
|
|
Descripción
|
|
----------------------
|
|
|
|
A resource to add to an :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`. This animation node will execute a sub-animation and return once it finishes. Blend times for fading in and out can be customized, as well as filters.
|
|
|
|
After setting the request and changing the animation playback, the one-shot node automatically clears the request on the next process frame by setting its ``request`` value to :ref:`ONE_SHOT_REQUEST_NONE<class_AnimationNodeOneShot_constant_ONE_SHOT_REQUEST_NONE>`.
|
|
|
|
|
|
.. tabs::
|
|
|
|
.. code-tab:: gdscript
|
|
|
|
# Play child animation connected to "shot" port.
|
|
animation_tree.set("parameters/OneShot/request", AnimationNodeOneShot.ONE_SHOT_REQUEST_FIRE)
|
|
# Alternative syntax (same result as above).
|
|
animation_tree["parameters/OneShot/request"] = AnimationNodeOneShot.ONE_SHOT_REQUEST_FIRE
|
|
|
|
# Abort child animation connected to "shot" port.
|
|
animation_tree.set("parameters/OneShot/request", AnimationNodeOneShot.ONE_SHOT_REQUEST_ABORT)
|
|
# Alternative syntax (same result as above).
|
|
animation_tree["parameters/OneShot/request"] = AnimationNodeOneShot.ONE_SHOT_REQUEST_ABORT
|
|
|
|
# Abort child animation with fading out connected to "shot" port.
|
|
animation_tree.set("parameters/OneShot/request", AnimationNodeOneShot.ONE_SHOT_REQUEST_FADE_OUT)
|
|
# Alternative syntax (same result as above).
|
|
animation_tree["parameters/OneShot/request"] = AnimationNodeOneShot.ONE_SHOT_REQUEST_FADE_OUT
|
|
|
|
# Get current state (read-only).
|
|
animation_tree.get("parameters/OneShot/active")
|
|
# Alternative syntax (same result as above).
|
|
animation_tree["parameters/OneShot/active"]
|
|
|
|
# Get current internal state (read-only).
|
|
animation_tree.get("parameters/OneShot/internal_active")
|
|
# Alternative syntax (same result as above).
|
|
animation_tree["parameters/OneShot/internal_active"]
|
|
|
|
.. code-tab:: csharp
|
|
|
|
// Play child animation connected to "shot" port.
|
|
animationTree.Set("parameters/OneShot/request", (int)AnimationNodeOneShot.OneShotRequest.Fire);
|
|
|
|
// Abort child animation connected to "shot" port.
|
|
animationTree.Set("parameters/OneShot/request", (int)AnimationNodeOneShot.OneShotRequest.Abort);
|
|
|
|
// Abort child animation with fading out connected to "shot" port.
|
|
animationTree.Set("parameters/OneShot/request", (int)AnimationNodeOneShot.OneShotRequest.FadeOut);
|
|
|
|
// Get current state (read-only).
|
|
animationTree.Get("parameters/OneShot/active");
|
|
|
|
// Get current internal state (read-only).
|
|
animationTree.Get("parameters/OneShot/internal_active");
|
|
|
|
|
|
|
|
.. rst-class:: classref-introduction-group
|
|
|
|
Tutoriales
|
|
--------------------
|
|
|
|
- :doc:`Usando AnimationTree <../tutorials/animation/animation_tree>`
|
|
|
|
- `Demo de Shooter en Tercera Persona (TPS) <https://godotengine.org/asset-library/asset/2710>`__
|
|
|
|
.. rst-class:: classref-reftable-group
|
|
|
|
Propiedades
|
|
----------------------
|
|
|
|
.. table::
|
|
:widths: auto
|
|
|
|
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`bool<class_bool>` | :ref:`abort_on_reset<class_AnimationNodeOneShot_property_abort_on_reset>` | ``false`` |
|
|
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`bool<class_bool>` | :ref:`autorestart<class_AnimationNodeOneShot_property_autorestart>` | ``false`` |
|
|
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`float<class_float>` | :ref:`autorestart_delay<class_AnimationNodeOneShot_property_autorestart_delay>` | ``1.0`` |
|
|
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`float<class_float>` | :ref:`autorestart_random_delay<class_AnimationNodeOneShot_property_autorestart_random_delay>` | ``0.0`` |
|
|
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`bool<class_bool>` | :ref:`break_loop_at_end<class_AnimationNodeOneShot_property_break_loop_at_end>` | ``false`` |
|
|
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`Curve<class_Curve>` | :ref:`fadein_curve<class_AnimationNodeOneShot_property_fadein_curve>` | |
|
|
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`float<class_float>` | :ref:`fadein_time<class_AnimationNodeOneShot_property_fadein_time>` | ``0.0`` |
|
|
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`Curve<class_Curve>` | :ref:`fadeout_curve<class_AnimationNodeOneShot_property_fadeout_curve>` | |
|
|
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`float<class_float>` | :ref:`fadeout_time<class_AnimationNodeOneShot_property_fadeout_time>` | ``0.0`` |
|
|
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`MixMode<enum_AnimationNodeOneShot_MixMode>` | :ref:`mix_mode<class_AnimationNodeOneShot_property_mix_mode>` | ``0`` |
|
|
+---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
Enumeraciones
|
|
--------------------------
|
|
|
|
.. _enum_AnimationNodeOneShot_OneShotRequest:
|
|
|
|
.. rst-class:: classref-enumeration
|
|
|
|
enum **OneShotRequest**: :ref:`🔗<enum_AnimationNodeOneShot_OneShotRequest>`
|
|
|
|
.. _class_AnimationNodeOneShot_constant_ONE_SHOT_REQUEST_NONE:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`OneShotRequest<enum_AnimationNodeOneShot_OneShotRequest>` **ONE_SHOT_REQUEST_NONE** = ``0``
|
|
|
|
El estado predeterminado de la petición. No se hace nada.
|
|
|
|
.. _class_AnimationNodeOneShot_constant_ONE_SHOT_REQUEST_FIRE:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`OneShotRequest<enum_AnimationNodeOneShot_OneShotRequest>` **ONE_SHOT_REQUEST_FIRE** = ``1``
|
|
|
|
La petición para reproducir la animación conectada al puerto "shot".
|
|
|
|
.. _class_AnimationNodeOneShot_constant_ONE_SHOT_REQUEST_ABORT:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`OneShotRequest<enum_AnimationNodeOneShot_OneShotRequest>` **ONE_SHOT_REQUEST_ABORT** = ``2``
|
|
|
|
La petición para detener la animación conectada al puerto "shot".
|
|
|
|
.. _class_AnimationNodeOneShot_constant_ONE_SHOT_REQUEST_FADE_OUT:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`OneShotRequest<enum_AnimationNodeOneShot_OneShotRequest>` **ONE_SHOT_REQUEST_FADE_OUT** = ``3``
|
|
|
|
La petición para aplicar un fundido de salida a la animación conectada al puerto "shot".
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _enum_AnimationNodeOneShot_MixMode:
|
|
|
|
.. rst-class:: classref-enumeration
|
|
|
|
enum **MixMode**: :ref:`🔗<enum_AnimationNodeOneShot_MixMode>`
|
|
|
|
.. _class_AnimationNodeOneShot_constant_MIX_MODE_BLEND:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`MixMode<enum_AnimationNodeOneShot_MixMode>` **MIX_MODE_BLEND** = ``0``
|
|
|
|
Combina dos animaciones. Véase también :ref:`AnimationNodeBlend2<class_AnimationNodeBlend2>`.
|
|
|
|
.. _class_AnimationNodeOneShot_constant_MIX_MODE_ADD:
|
|
|
|
.. rst-class:: classref-enumeration-constant
|
|
|
|
:ref:`MixMode<enum_AnimationNodeOneShot_MixMode>` **MIX_MODE_ADD** = ``1``
|
|
|
|
Combina dos animaciones de forma aditiva. Véase también :ref:`AnimationNodeAdd2<class_AnimationNodeAdd2>`.
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
Descripciones de Propiedades
|
|
--------------------------------------------------------
|
|
|
|
.. _class_AnimationNodeOneShot_property_abort_on_reset:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`bool<class_bool>` **abort_on_reset** = ``false`` :ref:`🔗<class_AnimationNodeOneShot_property_abort_on_reset>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_abort_on_reset**\ (\ value\: :ref:`bool<class_bool>`\ )
|
|
- :ref:`bool<class_bool>` **is_aborted_on_reset**\ (\ )
|
|
|
|
If ``true``, the sub-animation will abort if resumed with a reset after a prior interruption.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationNodeOneShot_property_autorestart:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`bool<class_bool>` **autorestart** = ``false`` :ref:`🔗<class_AnimationNodeOneShot_property_autorestart>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_autorestart**\ (\ value\: :ref:`bool<class_bool>`\ )
|
|
- :ref:`bool<class_bool>` **has_autorestart**\ (\ )
|
|
|
|
If ``true``, the sub-animation will restart automatically after finishing.
|
|
|
|
In other words, to start auto restarting, the animation must be played once with the :ref:`ONE_SHOT_REQUEST_FIRE<class_AnimationNodeOneShot_constant_ONE_SHOT_REQUEST_FIRE>` request. The :ref:`ONE_SHOT_REQUEST_ABORT<class_AnimationNodeOneShot_constant_ONE_SHOT_REQUEST_ABORT>` request stops the auto restarting, but it does not disable the :ref:`autorestart<class_AnimationNodeOneShot_property_autorestart>` itself. So, the :ref:`ONE_SHOT_REQUEST_FIRE<class_AnimationNodeOneShot_constant_ONE_SHOT_REQUEST_FIRE>` request will start auto restarting again.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationNodeOneShot_property_autorestart_delay:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`float<class_float>` **autorestart_delay** = ``1.0`` :ref:`🔗<class_AnimationNodeOneShot_property_autorestart_delay>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_autorestart_delay**\ (\ value\: :ref:`float<class_float>`\ )
|
|
- :ref:`float<class_float>` **get_autorestart_delay**\ (\ )
|
|
|
|
El retardo con el cual un reinicio automatico es lanzado, en segundos.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationNodeOneShot_property_autorestart_random_delay:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`float<class_float>` **autorestart_random_delay** = ``0.0`` :ref:`🔗<class_AnimationNodeOneShot_property_autorestart_random_delay>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_autorestart_random_delay**\ (\ value\: :ref:`float<class_float>`\ )
|
|
- :ref:`float<class_float>` **get_autorestart_random_delay**\ (\ )
|
|
|
|
Si :ref:`autorestart<class_AnimationNodeOneShot_property_autorestart>` es ``true``, un retardo aleatorio adicional (en segundos) entre 0 y este valor sera añadido al [member autorestart_delay.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationNodeOneShot_property_break_loop_at_end:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`bool<class_bool>` **break_loop_at_end** = ``false`` :ref:`🔗<class_AnimationNodeOneShot_property_break_loop_at_end>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_break_loop_at_end**\ (\ value\: :ref:`bool<class_bool>`\ )
|
|
- :ref:`bool<class_bool>` **is_loop_broken_at_end**\ (\ )
|
|
|
|
Si es ``true``, interrumpe el bucle al final del ciclo de bucle para la transición, incluso si la animación está en bucle.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationNodeOneShot_property_fadein_curve:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`Curve<class_Curve>` **fadein_curve** :ref:`🔗<class_AnimationNodeOneShot_property_fadein_curve>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_fadein_curve**\ (\ value\: :ref:`Curve<class_Curve>`\ )
|
|
- :ref:`Curve<class_Curve>` **get_fadein_curve**\ (\ )
|
|
|
|
Determina cómo se suaviza el fundido cruzado (cross-fading) entre animaciones. Si está vacío, la transición será lineal. Debe ser una :ref:`Curve<class_Curve>` unitaria.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationNodeOneShot_property_fadein_time:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`float<class_float>` **fadein_time** = ``0.0`` :ref:`🔗<class_AnimationNodeOneShot_property_fadein_time>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_fadein_time**\ (\ value\: :ref:`float<class_float>`\ )
|
|
- :ref:`float<class_float>` **get_fadein_time**\ (\ )
|
|
|
|
La duración del fundido de entrada (fade-in). Por ejemplo, si se establece en ``1.0`` para una animación de 5 segundos de duración, se producirá un fundido cruzado que comienza en el segundo 0 y termina en el segundo 1 durante la animación.
|
|
|
|
\ **Nota:** **AnimationNodeOneShot** transiciona el estado actual después de que el fundido haya finalizado.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationNodeOneShot_property_fadeout_curve:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`Curve<class_Curve>` **fadeout_curve** :ref:`🔗<class_AnimationNodeOneShot_property_fadeout_curve>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_fadeout_curve**\ (\ value\: :ref:`Curve<class_Curve>`\ )
|
|
- :ref:`Curve<class_Curve>` **get_fadeout_curve**\ (\ )
|
|
|
|
Determina cómo se suaviza el fundido cruzado (cross-fading) entre animaciones. Si está vacío, la transición será lineal. Debe ser una :ref:`Curve<class_Curve>` unitaria.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationNodeOneShot_property_fadeout_time:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`float<class_float>` **fadeout_time** = ``0.0`` :ref:`🔗<class_AnimationNodeOneShot_property_fadeout_time>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_fadeout_time**\ (\ value\: :ref:`float<class_float>`\ )
|
|
- :ref:`float<class_float>` **get_fadeout_time**\ (\ )
|
|
|
|
La duración del fundido de salida (fade-out). Por ejemplo, si se establece en ``1.0`` para una animación de 5 segundos de duración, se producirá un fundido cruzado que comienza en el segundo 4 y termina en el segundo 5 durante la animación.
|
|
|
|
\ **Nota:** **AnimationNodeOneShot** transiciona el estado actual después de que el fundido haya finalizado.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_AnimationNodeOneShot_property_mix_mode:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`MixMode<enum_AnimationNodeOneShot_MixMode>` **mix_mode** = ``0`` :ref:`🔗<class_AnimationNodeOneShot_property_mix_mode>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_mix_mode**\ (\ value\: :ref:`MixMode<enum_AnimationNodeOneShot_MixMode>`\ )
|
|
- :ref:`MixMode<enum_AnimationNodeOneShot_MixMode>` **get_mix_mode**\ (\ )
|
|
|
|
El tipo de mezcla.
|
|
|
|
.. |virtual| replace:: :abbr:`virtual (Normalmente, este método debería ser sobreescrito por el usuario para que tenga algún efecto.)`
|
|
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
|
.. |const| replace:: :abbr:`const (Este método no tiene efectos secundarios. No modifica ninguna de las variables miembro de la instancia.)`
|
|
.. |vararg| replace:: :abbr:`vararg (Este método permite agregar cualquier número de argumentos después de los descritos aquí.)`
|
|
.. |constructor| replace:: :abbr:`constructor (Este método se utiliza para construir un tipo.)`
|
|
.. |static| replace:: :abbr:`static (Este método no necesita una instancia para ser llamado, por lo que puede llamarse directamente utilizando el nombre de la clase.)`
|
|
.. |operator| replace:: :abbr:`operator (Este método describe un operador válido para usar con este tipo como operando izquierdo.)`
|
|
.. |bitfield| replace:: :abbr:`BitField (Este valor es un entero compuesto como una máscara de bits de las siguientes banderas.)`
|
|
.. |void| replace:: :abbr:`void (Sin valor de retorno.)`
|