PlayableDirector
Instantiates a PlayableGraph from a PlayableAsset and controls playback of Playable objects. This API is mainly designed to provide scheduling and scene binding support and scheduling for the Timeline package. Our users may find limited use for it otherwise. Most of the functionality of this class can be replicated by using PlayableGraph.
Read time 8 minutesLast updated 11 days ago
Definition
- Type: Class
- Namespace: UnityEngine.Playables
- Assembly: UnityEngine.DirectorModule
- Inherits from: Behaviour
- Implements: IExposedPropertyTable
[HelpURL("https://docs.unity3d.com/ScriptReference/Playables.PlayableDirector.html")]public class PlayableDirector : Behaviour, IExposedPropertyTable
Properties
Property | Description |
|---|---|
| duration | The duration of the currently connected Playable in seconds. |
| extrapolationMode | Controls how the time is incremented when it goes beyond the duration of the playable. |
| initialTime | The time at which the Playable should start when first played. |
| playableAsset | The PlayableAsset that is used to instantiate a playable for playback. |
| playableGraph | The PlayableGraph created by the PlayableDirector. |
| playOnAwake | Whether the playable asset will start playing back as soon as the component awakes. |
| state | The current playing state of the component. (Read Only) |
| time | The component's current time. This value is incremented according to the PlayableDirector.timeUpdateMode when it is playing. You can also change this value manually. |
| timeUpdateMode | Controls how time is incremented when playing back. |
Methods
Method | Description |
|---|---|
| ClearGenericBinding | Clears the binding of a reference object. |
| ClearReferenceValue | Clears an exposed reference value. |
| DeferredEvaluate | Schedules the PlayableDirector to perform PlayableGraph.Evaluate on the PlayableGraph associated with the PlayableDirector.playableAsset on the next update. |
| Evaluate | Immediately performs PlayableGraph.Evaluate on the PlayableGraph associated with the PlayableDirector.playableAsset at PlayableDirector.time. |
| GetGenericBinding | Returns a binding to a reference object. |
| GetReferenceValue | Retrieves an ExposedReference binding. |
| Pause | Pauses playback of the currently running playable. |
| Play | Instatiates a Playable using the provided PlayableAsset and starts playback. |
| RebindPlayableGraphOutputs | Rebinds each PlayableOutput of the PlayableGraph. |
| RebuildGraph | Discards the existing PlayableGraph and creates a new instance. |
| Resume | Resume playing a paused playable. |
| SetGenericBinding | Sets the binding of a reference object from a PlayableBinding. |
| SetReferenceValue | Sets an ExposedReference value. |
| Stop | Stops playback of the current Playable and destroys the corresponding graph. |
Events
Member | Description |
|---|---|
| paused | Event that is raised when a PlayableDirector component has paused. |
| played | Event that is raised when a PlayableDirector component has begun playing. |
| stopped | Event that is raised when a PlayableDirector component has stopped. |
Inheritance
Operators
Operator | Description |
|---|---|
| operator == | Compares two object references to see if they refer to the same object. |
| bool | Determines whether the object exists. |
| operator != | Compares if two objects refer to a different object. |