public static Animations.PropertyStreamHandle BindStreamProperty (Animator animator, Transform transform, Type type, string property);
public static Animations.PropertyStreamHandle BindStreamProperty (Animator animator, Transform transform, Type type, string property, bool isObjectReference= false);

参数

animator调用此方法的 Animator 实例。
transform目标 Transform
type Component 类型。
property要绑定的属性。
isObjectReference如果要绑定的属性会动画化诸如 SpriteRenderer.sprite 之类的对象,则需要将 isObjectReference 设置为 true。

返回

PropertyStreamHandle 返回表示新绑定的 PropertyStreamHandle。

描述

创建一个 PropertyStreamHandle,用于表示已绑定到 AnimatorTransformComponent 属性上的新绑定。

您可以绑定尚不存在的属性。例如,您可以绑定稍后动态添加的 MonoBehaviour 上的属性。在这种情况下,您需要在 GameObject 上添加 MonoBehaviour 后使用 ResolveAllStreamHandles 手动解析句柄。