适用于实现 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);
}
}