适用于实现 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。 |
| GetDelay | 返回可播放项的延时。 |
| GetDuration | 返回 Playable 的持续时间。 |
| GetGraph | 返回拥有此 Playable 的 PlayableGraph。Playable 只能在用于创建它的图中使用。 |
| GetInput | 返回给定输入端口索引处连接的 Playable。 |
| GetInputCount | 返回 Playable 支持的输入数量。 |
| GetInputWeight | 返回给定输入端口索引处连接的 Playable 的权重。 |
| GetLeadTime | 返回 Playable 前置时间(以秒为单位)。 |
| GetOutput | 返回给定输出端口索引处连接的 Playable。 |
| GetOutputCount | 返回 Playable 支持的输出数量。 |
| GetPlayState | 返回 Playable 的当前播放状态。 |
| GetPreviousTime | 返回 Playable 的上一个本地时间。 |
| GetPropagateSetTime | 返回此 Playable 的时间传播行为。 |
| GetSpeed | 返回应用于当前 Playable 的速度乘数。 |
| GetTime | 返回 Playable 的当前本地时间。 |
| IsDelayed | 返回指示 Playable 是否存在延迟的值。 |
| IsDone | 返回指示可播放项已完成操作的标志。 |
| IsValid | 返回当前 Playable 的有效性。 |
| Pause | 发出暂停 Playable 的通知。 |
| Play | 开始播放 Playable。 |
| SetDelay | 设置可播放项开始播放之前的延时。 |
| SetDone | 更改指示可播放项已完成操作的标志。 |
| SetDuration | 更改 Playable 的持续时间。 |
| SetInputCount | 更改 Playable 支持的输入数量。 |
| SetInputWeight | 更改连接到当前 Playable 的 Playable 的权重。 |
| SetLeadTime | 设置 Playable 前置时间(以秒为单位)。 |
| SetOutputCount | 更改 Playable 支持的输出数量。 |
| SetPropagateSetTime | 更改此 Playable 的时间传播行为。 |
| SetSpeed | 更改应用于当前 Playable 的速度乘数。 |
| SetTime | 更改 Playable 的当前本地时间。 |