Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


BindSceneProperty

Create a PropertySceneHandle representing the new binding on the Component property of a Transform in the Scene.
Read time 2 minutesLast updated 10 days ago

Definition

BindSceneProperty(Animator, Transform, Type, string)

Create a PropertySceneHandle representing the new binding on the Component property of a Transform in the Scene.
public static PropertySceneHandle BindSceneProperty(this Animator animator, Transform transform, Type type, string property)

Parameters

animator

The Animator instance that calls this method.

transform

The Transform to target.

type

The Component type.

property

The property to bind.

Returns

Type

Description

PropertySceneHandleReturns the PropertySceneHandle that represents the new binding.

Remarks

You can bind a property that doesn't exist yet. For example you can bind a property on a MonoBehaviour that will be added later dynamically. In this case, you need to manually resolve the handle after adding the MonoBehaviour on the GameObject, using AnimatorJobExtensions.ResolveAllSceneHandles.

BindSceneProperty(Animator, Transform, Type, string, bool)

Create a PropertySceneHandle representing the new binding on the Component property of a Transform in the Scene.
public static PropertySceneHandle BindSceneProperty(this Animator animator, Transform transform, Type type, string property, bool isObjectReference)

Parameters

animator

The Animator instance that calls this method.

transform

The Transform to target.

type

The Component type.

property

The property to bind.

isObjectReference

isObjectReference need to be set to true if the property to bind does access an Object like _sprite.

Returns

Type

Description

PropertySceneHandleReturns the PropertySceneHandle that represents the new binding.

Remarks

You can bind a property that doesn't exist yet. For example you can bind a property on a MonoBehaviour that will be added later dynamically. In this case, you need to manually resolve the handle after adding the MonoBehaviour on the GameObject, using AnimatorJobExtensions.ResolveAllSceneHandles.