Version: 2023.2
public static Playables.PlayableBinding Create (string name, Object key, Type type);

参数

key 对 UnityEngine.Object(充当此绑定的键)的引用。
type 将绑定到 ScriptPlayableOutput 的对象类型。
name ScriptPlayableOutput 的名称。

返回

PlayableBinding 返回一个 PlayableBinding,其中包含用于创建 ScriptPlayableOutput 的信息。

描述

创建一个 PlayableBinding,其中包含表示 ScriptPlayableOutput 的信息。

using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Playables;

public class CustomPlayableAsset : PlayableAsset { public override Playable CreatePlayable(PlayableGraph graph, GameObject owner) { return Playable.Create(graph); }

public override IEnumerable<PlayableBinding> outputs { get { yield return ScriptPlayableBinding.Create("ScriptPlayableOutput", this, typeof(Renderer)); } } }