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.

Playable

class in UnityEngine.Experimental.Director

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

Descripción

Playables are customizable runtime objects that can be connected together in a tree to create complex behaviours.

Playables can be used to create complex and flexible data evaluation trees. They can be connected together (via Playable.Connect), after which each Playable in the tree can set the "weight" or "influence" of each of its children. Once a tree of Playable is created, it can be "played" by using it with a DirectorPlayer component. (see DirectorPlayer.Play)

Once a Playable (or tree of Playable) is associated with a DirectorPlayer, the player will traverse the Playables one by one. Each time it encounters a Playable in the tree, it will call its PrepareFrame method. This allows the Playable to "prepare itself for the next evaluation". It is during the PrepareFrame stage that each Playable can modify its children (either by adding new inputs or by removing some of them). This enables Playable to "spawn" new children branches in the Playable tree at runtime. This means that Playable trees are not static structures. They can adapt and change over time.

AnimationPlayables are a good example usage of the Playables. They allow existing AnimationClips to be connected together via AnimationPlayableMixers, on the fly. This can be used to programatically create animation behaviours such as locomotion blendtrees. Once a tree of AnimationPlayables is created, it can be passed to an Animator component via the Animator.Play method.

Variables

inputCountThe count of inputs on the Playable. This count includes slots that aren't connected to anything. This is equivalent to, but much faster than calling GetInputs().Length.
outputCountThe count of inputs on the Playable. This count includes slots that aren't connected to anything. This is equivalent to, but much faster than calling GetOutputs().Length.
stateCurrent PlayState of this playable. This indicates whether the Playable is currently playing or paused.
timeCurrent local time for this Playable.

Funciones Públicas

ClearInputsSafely disconnects all connected inputs and resizes the input array to 0.
DisposeImplements IDisposable. Call this method to release the resources allocated by the Playable.
GetInputReturns the Playable connected at the specified index.
GetInputsReturns a lists of the input Playables.
GetInputWeightGet the weight of the Playable at a specified index.
GetOutputReturns the Playable connected at the specified output index.
GetOutputsGet the list of ouputs connected on this Playable.
ProcessFrameEvaluates the Playable with a delta time.
SetInputWeightSet the weight of an input.

Funciones Estáticas

ConnectConnects two Playables together.
DisconnectDisconnects an input from a Playable.

Mensajes

OnSetPlayStateCallback called when the PlayState has changed
OnSetTimeCallback called when the current time has changed
PrepareFramePrepares the Playable tree for the next frame. PrepareFrame is called before the tree is evaluated.