适用于实现 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 的当前播放状态。 |
GetPreviousTime | 返回 Playable 的上一个本地时间。 |
GetPropagateSetTime | 返回此 Playable 的时间传播行为。 |
GetSpeed | 返回应用于当前 Playable 的速度乘数。 |
GetTime | 返回 Playable 的当前本地时间。 |
GetTraversalMode | 返回多输出可播放项的传播模式。 |
IsDone | 返回指示可播放项已完成操作的标志。 |
IsNull | 如果 Playable 为 null,则返回 true,否则返回 false。 |
IsValid | 返回当前 Playable 的有效性。 |
Pause | 发出暂停 Playable 的通知。 |
Play | 开始播放 Playable。 |
SetDone | 更改指示可播放项已完成操作的标志。 |
SetDuration | 更改 Playable 的持续时间。 |
SetInputCount | 更改 Playable 支持的输入数量。 |
SetInputWeight | 更改连接到当前 Playable 的 Playable 的权重。 |
SetLeadTime | 设置 Playable 前置时间(以秒为单位)。 |
SetOutputCount | 更改 Playable 支持的输出数量。 |
SetPropagateSetTime | 更改此 Playable 的时间传播行为。 |
SetSpeed | 更改应用于当前 Playable 的速度乘数。 |
SetTime | 更改 Playable 的当前本地时间。 |
SetTraversalMode | 设置多输出可播放项的 PrepareFrame 和 ProcessFrame 传播模式。 |
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.