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

Script language

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

PlayableExtensions

class in UnityEngine.Playables

/

Implemented in:UnityEngine.CoreModule

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

Extensions for all the types that implements IPlayable.

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

no example available in JavaScript
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

AddInputCreate a new input port and connect it to the output port of the given Playable.
ConnectInputConnect the output port of a Playable to one of the input ports.
DestroyDestroys the current Playable.
GetDelayReturns the delay of the playable.
GetDurationReturns the duration of the Playable.
GetGraphReturns the PlayableGraph that owns this Playable. A Playable can only be used in the graph that was used to create it.
GetInputReturns the Playable connected at the given input port index.
GetInputCountReturns the number of inputs supported by the Playable.
GetInputWeightReturns the weight of the Playable connected at the given input port index.
GetLeadTimeReturns the Playable lead time in seconds.
GetOutputReturns the Playable connected at the given output port index.
GetOutputCountReturns the number of outputs supported by the Playable.
GetPlayStateReturns the current PlayState of the Playable.
GetPreviousTimeReturns the previous local time of the Playable.
GetPropagateSetTimeReturns the time propagation behavior of this Playable.
GetSpeedReturns the speed multiplier that is applied to the the current Playable.
GetTimeReturns the current local time of the Playable.
IsDelayedReturns whether or not the Playable has a delay.
IsDoneReturns a flag indicating that a playable has completed its operation.
IsValidReturns the vality of the current Playable.
PauseTells to pause the Playable.
PlayStarts to play the Playable.
SetDelaySet a delay until the playable starts.
SetDoneChanges a flag indicating that a playable has completed its operation.
SetDurationChanges the duration of the Playable.
SetInputCountChanges the number of inputs supported by the Playable.
SetInputWeightChanges the weight of the Playable connected to the current Playable.
SetLeadTimeSets the Playable lead time in seconds.
SetOutputCountChanges the number of outputs supported by the Playable.
SetPropagateSetTimeChanges the time propagation behavior of this Playable.
SetSpeedChanges the speed multiplier that is applied to the the current Playable.
SetTimeChanges the current local time of the Playable.
对文档有任何疑问,请移步至开发者社区提问,我们将尽快为您解答