Version: 5.3 (switch to 5.4b)
IdiomaEnglish
  • C#
  • JS

Idioma de script

Selecciona tu lenguaje de programación favorito. Todos los fragmentos de código serán mostrados en este lenguaje.

Animation.Play

Sugiere un cambio

¡Éxito!

Gracias por ayudarnos a mejorar la calidad de la documentación de Unity. A pesar de que no podemos aceptar todas las sugerencias, leemos cada cambio propuesto por nuestros usuarios y actualizaremos los que sean aplicables.

Cerrar

No se puedo enviar

Por alguna razón su cambio sugerido no pudo ser enviado. Por favor <a>intente nuevamente</a> en unos minutos. Gracias por tomarse un tiempo para ayudarnos a mejorar la calidad de la documentación de Unity.

Cerrar

Cancelar

Cambiar al Manual
public function Play(mode: PlayMode = PlayMode.StopSameLayer): bool;
public bool Play(PlayMode mode = PlayMode.StopSameLayer);
public function Play(animation: string, mode: PlayMode = PlayMode.StopSameLayer): bool;
public bool Play(string animation, PlayMode mode = PlayMode.StopSameLayer);
public function Play(mode: PlayMode = PlayMode.StopSameLayer): bool;
public bool Play(PlayMode mode = PlayMode.StopSameLayer);
public function Play(animation: string, mode: PlayMode = PlayMode.StopSameLayer): bool;
public bool Play(string animation, PlayMode mode = PlayMode.StopSameLayer);

Parámetros

Descripción

Reproduce la animación sin ninguna mezcla.

If no name is supplied then the default animation will be played. In cases where the animation can't be played (ie, there is no default animation or no animation with the specified name), the function will return false.

The optional playMode lets you choose how this animation will affect others already playing.

If the specified animation is already playing then other animations will be stopped but the animation will not rewind to the beginning.

When the end of the animation is reached it will automatically be stopped and rewound to the start unless the PlayMode is set to Loop.

Note that if you call Animation.Play on an object during a frame update where the object is also deactivated then the call will effectively be cancelled; the animation will not start playing when the object is later reactivated. However, if you make the call on a subsequent frame (ie, while the object is still inactive) then the animation will start playing after reactivation.