# PlayableExtensions

> Extensions for all the types that implements IPlayable.

## Definition

* **Type:** Class
* **Namespace:** [UnityEngine.Playables](/engine/6000.0/script-reference/unityengine/playables.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public static class PlayableExtensions
```

## Remarks

Extension methods are static methods that can be called as if they were instance methods on the extended type.

## Examples

```csharp
using UnityEngine;
using UnityEngine.Animations;
using UnityEngine.Playables;

public class ExamplePlayableBehaviour : PlayableBehaviour
{
    void Start()
    {
        PlayableGraph graph = PlayableGraph.Create();
        AnimationMixerPlayable mixer = AnimationMixerPlayable.Create(graph, 1);

        // Calling method PlayableExtensions.SetDuration on AnimationMixerPlayable as if it was an instance method.
        mixer.SetDuration(10);

        // The line above is the same as calling directly PlayableExtensions.SetDuration, but it is more compact and readable.
        PlayableExtensions.SetDuration(mixer, 10);
    }
}
```

## Static Methods

| Method                                                                                                                 | Description                                                                                                                                                                                                                                                                                                                                  |
| ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [AddInput](/engine/6000.0/script-reference/unityengine/playables/playableextensions/addinput.md)                       | Create a new input port and connect it to the output port of the given [Playable](/engine/6000.0/script-reference/unityengine/playables/playable.md).                                                                                                                                                                                        |
| [ConnectInput](/engine/6000.0/script-reference/unityengine/playables/playableextensions/connectinput.md)               | Connect the output port of a [Playable](/engine/6000.0/script-reference/unityengine/playables/playable.md) to one of the input ports.                                                                                                                                                                                                        |
| [Destroy](/engine/6000.0/script-reference/unityengine/playables/playableextensions/destroy.md)                         | Destroys the current [Playable](/engine/6000.0/script-reference/unityengine/playables/playable.md).                                                                                                                                                                                                                                          |
| [DisconnectInput](/engine/6000.0/script-reference/unityengine/playables/playableextensions/disconnectinput.md)         | Disconnect the input port of a [Playable](/engine/6000.0/script-reference/unityengine/playables/playable.md).                                                                                                                                                                                                                                |
| [GetDuration](/engine/6000.0/script-reference/unityengine/playables/playableextensions/getduration.md)                 | Returns the duration of the [Playable](/engine/6000.0/script-reference/unityengine/playables/playable.md).                                                                                                                                                                                                                                   |
| [GetGraph](/engine/6000.0/script-reference/unityengine/playables/playableextensions/getgraph.md)                       | Returns the [PlayableGraph](/engine/6000.0/script-reference/unityengine/playables/playablegraph.md) that owns this [Playable](/engine/6000.0/script-reference/unityengine/playables/playable.md).  A [Playable](/engine/6000.0/script-reference/unityengine/playables/playable.md) can only be used in the graph that was used to create it. |
| [GetInput](/engine/6000.0/script-reference/unityengine/playables/playableextensions/getinput.md)                       | Returns the [Playable](/engine/6000.0/script-reference/unityengine/playables/playable.md) connected at the given input port index.                                                                                                                                                                                                           |
| [GetInputCount](/engine/6000.0/script-reference/unityengine/playables/playableextensions/getinputcount.md)             | Returns the number of inputs supported by the [Playable](/engine/6000.0/script-reference/unityengine/playables/playable.md).                                                                                                                                                                                                                 |
| [GetInputWeight](/engine/6000.0/script-reference/unityengine/playables/playableextensions/getinputweight.md)           | Returns the weight of the [Playable](/engine/6000.0/script-reference/unityengine/playables/playable.md) connected at the given input port index.                                                                                                                                                                                             |
| [GetLeadTime](/engine/6000.0/script-reference/unityengine/playables/playableextensions/getleadtime.md)                 | Returns the [Playable](/engine/6000.0/script-reference/unityengine/playables/playable.md) lead time in seconds.                                                                                                                                                                                                                              |
| [GetOutput](/engine/6000.0/script-reference/unityengine/playables/playableextensions/getoutput.md)                     | Returns the [Playable](/engine/6000.0/script-reference/unityengine/playables/playable.md) connected at the given output port index.                                                                                                                                                                                                          |
| [GetOutputCount](/engine/6000.0/script-reference/unityengine/playables/playableextensions/getoutputcount.md)           | Returns the number of outputs supported by the [Playable](/engine/6000.0/script-reference/unityengine/playables/playable.md).                                                                                                                                                                                                                |
| [GetPlayState](/engine/6000.0/script-reference/unityengine/playables/playableextensions/getplaystate.md)               | Returns the current PlayState of the [Playable](/engine/6000.0/script-reference/unityengine/playables/playable.md).                                                                                                                                                                                                                          |
| [GetPreviousTime](/engine/6000.0/script-reference/unityengine/playables/playableextensions/getprevioustime.md)         | Returns the previous local time of the [Playable](/engine/6000.0/script-reference/unityengine/playables/playable.md).                                                                                                                                                                                                                        |
| [GetPropagateSetTime](/engine/6000.0/script-reference/unityengine/playables/playableextensions/getpropagatesettime.md) | Returns the time propagation behavior of this [Playable](/engine/6000.0/script-reference/unityengine/playables/playable.md).                                                                                                                                                                                                                 |
| [GetSpeed](/engine/6000.0/script-reference/unityengine/playables/playableextensions/getspeed.md)                       | Returns the speed multiplier that is applied to the the current [Playable](/engine/6000.0/script-reference/unityengine/playables/playable.md).                                                                                                                                                                                               |
| [GetTime](/engine/6000.0/script-reference/unityengine/playables/playableextensions/gettime.md)                         | Returns the current local time of the [Playable](/engine/6000.0/script-reference/unityengine/playables/playable.md).                                                                                                                                                                                                                         |
| [GetTraversalMode](/engine/6000.0/script-reference/unityengine/playables/playableextensions/gettraversalmode.md)       | Returns the propagation mode for the multi-output playable.                                                                                                                                                                                                                                                                                  |
| [IsDone](/engine/6000.0/script-reference/unityengine/playables/playableextensions/isdone.md)                           | Returns a flag indicating that a playable has completed its operation.                                                                                                                                                                                                                                                                       |
| [IsNull](/engine/6000.0/script-reference/unityengine/playables/playableextensions/isnull.md)                           | Returns true if the [Playable](/engine/6000.0/script-reference/unityengine/playables/playable.md) is null, false otherwise.                                                                                                                                                                                                                  |
| [IsValid](/engine/6000.0/script-reference/unityengine/playables/playableextensions/isvalid.md)                         | Returns the vality of the current [Playable](/engine/6000.0/script-reference/unityengine/playables/playable.md).                                                                                                                                                                                                                             |
| [Pause](/engine/6000.0/script-reference/unityengine/playables/playableextensions/pause.md)                             | Tells to pause the [Playable](/engine/6000.0/script-reference/unityengine/playables/playable.md).                                                                                                                                                                                                                                            |
| [Play](/engine/6000.0/script-reference/unityengine/playables/playableextensions/play.md)                               | Starts to play the [Playable](/engine/6000.0/script-reference/unityengine/playables/playable.md).                                                                                                                                                                                                                                            |
| [SetDone](/engine/6000.0/script-reference/unityengine/playables/playableextensions/setdone.md)                         | Changes a flag indicating that a playable has completed its operation.                                                                                                                                                                                                                                                                       |
| [SetDuration](/engine/6000.0/script-reference/unityengine/playables/playableextensions/setduration.md)                 | Changes the duration of the [Playable](/engine/6000.0/script-reference/unityengine/playables/playable.md).                                                                                                                                                                                                                                   |
| [SetInputCount](/engine/6000.0/script-reference/unityengine/playables/playableextensions/setinputcount.md)             | Changes the number of inputs supported by the [Playable](/engine/6000.0/script-reference/unityengine/playables/playable.md).                                                                                                                                                                                                                 |
| [SetInputWeight](/engine/6000.0/script-reference/unityengine/playables/playableextensions/setinputweight.md)           | Changes the weight of the [Playable](/engine/6000.0/script-reference/unityengine/playables/playable.md) connected to the current [Playable](/engine/6000.0/script-reference/unityengine/playables/playable.md).                                                                                                                              |
| [SetLeadTime](/engine/6000.0/script-reference/unityengine/playables/playableextensions/setleadtime.md)                 | Sets the [Playable](/engine/6000.0/script-reference/unityengine/playables/playable.md) lead time in seconds.                                                                                                                                                                                                                                 |
| [SetOutputCount](/engine/6000.0/script-reference/unityengine/playables/playableextensions/setoutputcount.md)           | Changes the number of outputs supported by the [Playable](/engine/6000.0/script-reference/unityengine/playables/playable.md).                                                                                                                                                                                                                |
| [SetPropagateSetTime](/engine/6000.0/script-reference/unityengine/playables/playableextensions/setpropagatesettime.md) | Changes the time propagation behavior of this [Playable](/engine/6000.0/script-reference/unityengine/playables/playable.md).                                                                                                                                                                                                                 |
| [SetSpeed](/engine/6000.0/script-reference/unityengine/playables/playableextensions/setspeed.md)                       | Changes the speed multiplier that is applied to the the current [Playable](/engine/6000.0/script-reference/unityengine/playables/playable.md).                                                                                                                                                                                               |
| [SetTime](/engine/6000.0/script-reference/unityengine/playables/playableextensions/settime.md)                         | Changes the current local time of the [Playable](/engine/6000.0/script-reference/unityengine/playables/playable.md).                                                                                                                                                                                                                         |
| [SetTraversalMode](/engine/6000.0/script-reference/unityengine/playables/playableextensions/settraversalmode.md)       | Sets the propagation mode of PrepareFrame and ProcessFrame for the multi-output playable.                                                                                                                                                                                                                                                    |
