PlayableOutputExtensions

class in UnityEngine.Playables

Switch to Manual

Description

适用于实现 IPlayableOutput 的所有类型的扩展。

扩展方法属于静态方法,可以像调用扩展类型上的实例方法那样调用它们。

using UnityEngine;
using UnityEngine.Playables;

public class ExamplePlayableBehaviour : PlayableBehaviour { void Start() { PlayableGraph graph = PlayableGraph.Create(); ScriptPlayableOutput scriptOutput = ScriptPlayableOutput.Create(graph, "MyOutput");

// Calling method PlayableExtensions.SetWeight on ScriptPlayableOutput as if it was an instance method. scriptOutput.SetWeight(10);

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

Static Functions

AddNotificationReceiverRegisters a new receiver that listens for notifications.
GetNotificationReceiversRetrieves the list of notification receivers currently registered on the output.
GetSourceOutputPortReturns the source playable's output connection index.
GetSourcePlayableReturns the source playable.
GetUserDataReturns the opaque user data. This is the same value as the last last argument of ProcessFrame.
GetWeightReturns the weight of the connection from the PlayableOutput to the source playable.
IsOutputNullReturns true if the PlayableOutput is null, false otherwise.
IsOutputValid
PushNotificationQueues a notification to be sent through the Playable system.
RemoveNotificationReceiverUnregisters a receiver on the output.
SetReferenceObjectSets the bound object to a new value. Used to associate an output to an object (Track asset in case of Timeline).
SetSourceOutputPortSets the source playable's output connection index. For playables with multiple outputs, this determines which sub-branch of the source playable generates this output.
SetSourcePlayableSets which playable that computes the output and which sub-tree index.
SetUserDataSets the opaque user data. This same data is passed as the last argument to ProcessFrame.
SetWeightSets the weight of the connection from the PlayableOutput to the source playable.