对所有实现 IPlayable 的类型的扩展。
扩展方法是静态方法,可以像在扩展类型上调用实例方法一样调用它们。
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); } }
| AddInput | 创建一个新的输入端口并将其连接到给定 Playable 的输出端口。 | 
| ConnectInput | 将 Playable 的输出端口连接到其中一个输入端口。 | 
| Destroy | 销毁当前 Playable。 | 
| DisconnectInput | 断开 Playable 的输入端口。 | 
| GetDuration | 返回 Playable 的持续时间。 | 
| GetGraph | 返回拥有此 Playable 的 PlayableGraph。Playable 只能在用于创建它的图形中使用。 | 
| GetInput | 返回在给定输入端口索引处连接的 Playable。 | 
| GetInputCount | 返回 Playable 支持的输入数量。 | 
| GetInputWeight | 返回在给定输入端口索引处连接的 Playable 的权重。 | 
| GetLeadTime | 返回 Playable 提前时间(以秒为单位)。 | 
| GetOutput | 返回在给定输出端口索引处连接的 Playable。 | 
| GetOutputCount | 返回 Playable 支持的输出数量。 | 
| GetPlayState | 返回 Playable 的当前 PlayState。 | 
| GetPreviousTime | 返回 Playable 的上一个本地时间。 | 
| GetPropagateSetTime | 返回此 Playable 的时间传播行为。 | 
| GetSpeed | 返回应用于当前 Playable 的速度倍增器。 | 
| GetTime | 返回 Playable 的当前本地时间。 | 
| GetTraversalMode | 返回多输出 Playable 的传播模式。 | 
| IsDone | 返回一个标志,指示 Playable 是否已完成其操作。 | 
| IsNull | 如果 Playable 为空,则返回 true,否则返回 false。 | 
| IsValid | 返回当前 Playable 的有效性。 | 
| Pause | 指示暂停 Playable。 | 
| Play | 开始播放 Playable。 | 
| SetDone | 更改一个标志,指示 Playable 是否已完成其操作。 | 
| SetDuration | 更改 Playable 的持续时间。 | 
| SetInputCount | 更改 Playable 支持的输入数量。 | 
| SetInputWeight | 更改连接到当前 Playable 的 Playable 的权重。 | 
| SetLeadTime | 设置 Playable 提前时间(以秒为单位)。 | 
| SetOutputCount | 更改 Playable 支持的输出数量。 | 
| SetPropagateSetTime | 更改此 Playable 的时间传播行为。 | 
| SetSpeed | 更改应用于当前 Playable 的速度倍增器。 | 
| SetTime | 更改 Playable 的当前本地时间。 | 
| SetTraversalMode | 设置多输出 Playable 的 PrepareFrame 和 ProcessFrame 的传播模式。 |