:github_url: hide .. _class_AnimationNodeOneShot: AnimationNodeOneShot ==================== **Hereda:** :ref:`AnimationNodeSync` **<** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` Reproduce una animaci贸n una vez en un :ref:`AnimationNodeBlendTree`. .. rst-class:: classref-introduction-group Descripci贸n ---------------------- A resource to add to an :ref:`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`. .. 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) `__ .. rst-class:: classref-reftable-group Propiedades ---------------------- .. table:: :widths: auto +---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ | :ref:`bool` | :ref:`abort_on_reset` | ``false`` | +---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ | :ref:`bool` | :ref:`autorestart` | ``false`` | +---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ | :ref:`float` | :ref:`autorestart_delay` | ``1.0`` | +---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ | :ref:`float` | :ref:`autorestart_random_delay` | ``0.0`` | +---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ | :ref:`bool` | :ref:`break_loop_at_end` | ``false`` | +---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ | :ref:`Curve` | :ref:`fadein_curve` | | +---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ | :ref:`float` | :ref:`fadein_time` | ``0.0`` | +---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ | :ref:`Curve` | :ref:`fadeout_curve` | | +---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ | :ref:`float` | :ref:`fadeout_time` | ``0.0`` | +---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ | :ref:`MixMode` | :ref:`mix_mode` | ``0`` | +---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Enumeraciones -------------------------- .. _enum_AnimationNodeOneShot_OneShotRequest: .. rst-class:: classref-enumeration enum **OneShotRequest**: :ref:`馃敆` .. _class_AnimationNodeOneShot_constant_ONE_SHOT_REQUEST_NONE: .. rst-class:: classref-enumeration-constant :ref:`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` **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` **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` **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:`馃敆` .. _class_AnimationNodeOneShot_constant_MIX_MODE_BLEND: .. rst-class:: classref-enumeration-constant :ref:`MixMode` **MIX_MODE_BLEND** = ``0`` Combina dos animaciones. V茅ase tambi茅n :ref:`AnimationNodeBlend2`. .. _class_AnimationNodeOneShot_constant_MIX_MODE_ADD: .. rst-class:: classref-enumeration-constant :ref:`MixMode` **MIX_MODE_ADD** = ``1`` Combina dos animaciones de forma aditiva. V茅ase tambi茅n :ref:`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` **abort_on_reset** = ``false`` :ref:`馃敆` .. rst-class:: classref-property-setget - |void| **set_abort_on_reset**\ (\ value\: :ref:`bool`\ ) - :ref:`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` **autorestart** = ``false`` :ref:`馃敆` .. rst-class:: classref-property-setget - |void| **set_autorestart**\ (\ value\: :ref:`bool`\ ) - :ref:`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` request. The :ref:`ONE_SHOT_REQUEST_ABORT` request stops the auto restarting, but it does not disable the :ref:`autorestart` itself. So, the :ref:`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` **autorestart_delay** = ``1.0`` :ref:`馃敆` .. rst-class:: classref-property-setget - |void| **set_autorestart_delay**\ (\ value\: :ref:`float`\ ) - :ref:`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` **autorestart_random_delay** = ``0.0`` :ref:`馃敆` .. rst-class:: classref-property-setget - |void| **set_autorestart_random_delay**\ (\ value\: :ref:`float`\ ) - :ref:`float` **get_autorestart_random_delay**\ (\ ) Si :ref:`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` **break_loop_at_end** = ``false`` :ref:`馃敆` .. rst-class:: classref-property-setget - |void| **set_break_loop_at_end**\ (\ value\: :ref:`bool`\ ) - :ref:`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` **fadein_curve** :ref:`馃敆` .. rst-class:: classref-property-setget - |void| **set_fadein_curve**\ (\ value\: :ref:`Curve`\ ) - :ref:`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` unitaria. .. rst-class:: classref-item-separator ---- .. _class_AnimationNodeOneShot_property_fadein_time: .. rst-class:: classref-property :ref:`float` **fadein_time** = ``0.0`` :ref:`馃敆` .. rst-class:: classref-property-setget - |void| **set_fadein_time**\ (\ value\: :ref:`float`\ ) - :ref:`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` **fadeout_curve** :ref:`馃敆` .. rst-class:: classref-property-setget - |void| **set_fadeout_curve**\ (\ value\: :ref:`Curve`\ ) - :ref:`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` unitaria. .. rst-class:: classref-item-separator ---- .. _class_AnimationNodeOneShot_property_fadeout_time: .. rst-class:: classref-property :ref:`float` **fadeout_time** = ``0.0`` :ref:`馃敆` .. rst-class:: classref-property-setget - |void| **set_fadeout_time**\ (\ value\: :ref:`float`\ ) - :ref:`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` **mix_mode** = ``0`` :ref:`馃敆` .. rst-class:: classref-property-setget - |void| **set_mix_mode**\ (\ value\: :ref:`MixMode`\ ) - :ref:`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.)`