Legacy Documentation: Version 5.6 (Go to current version)
LanguageEnglish
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

Experimental: this API is experimental and might be changed or removed in the future.

PlayableHandle

struct in UnityEngine.Experimental.Director

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

Handle representing a Playable created in a PlayableGraph. The PlayableHandle implements all general usage Playable methods.

Some Playables are implemented as internal C++ objects but are exposed as C# structs. Using PlayableHandle allows for the possibility of creating Playable graphs without allocating memory in your C# scripts that might later require garbage collection. One downside of using structs as opposed to classes is that structs in C# do not support inheritance. The GetObject method allows you to convert a Playable into its C# class type.

Static Variables

NullUsed to compare PlayableHandles.

Variables

durationThe duration of the Playable in seconds.
graphThe PlayableGraph that created the playable.
inputCountGets and Sets the number of inputs for the Playable.
isDoneA flag indicating that a playable has completed its operation.
outputCountGets and Sets the number of outputs for the Playable.
playStateWhen playing, the time will advance in the Playable during evaluation of the graph.
speedModulates how time is incremented when the Playable is playing.
timeThe current time of the Playable.

Public Functions

DestroyDestroys the Playable associated with this PlayableHandle.
GetInputReturns the PlayableHandle connected at the given input port index.
GetInputWeightReturns the weight of the Playable connected at the given input port index.
GetObjectReturns a Playable representation of the handle.
GetOutputReturns the PlayableHandle connected at the given ouput port index.
IsValidReturns true if the Playable is properly constructed by the PlayableGraph and has not been destroyed.
SetInputWeightSets the weight of the Playable connected at the given input port index.