CreateGenericBinding
Retrieves the GenericBinding that represents a specific property associated with a GameObject or one of its components.
Read time 2 minutesLast updated 10 days ago
Definition
- Type: Method
- Namespace: UnityEngine.Animations
- Assembly: UnityEngine.AnimationModule
CreateGenericBinding(Object, string, GameObject, bool, GenericBinding)
Retrieves the GenericBinding that represents a specific property associated with a GameObject or one of its components.
public static bool CreateGenericBinding(Object targetObject, string property, GameObject root, bool isObjectReference, out GenericBinding genericBinding)
Parameters
The target GameObject to extract the bindings from.
The name of the property.
A GameObject ancestor of targetObject. Use the ancestor to locate the targetObject within a transform hierarchy.
Specifies whether the property is an object reference. If you do not identify the property correctly, the method fails. Set this parameter to True if the property references an object. Set to False if the property is a float or an integer.
Returns the GenericBinding representing the property on the GameObject to animate.
Returns
Type | Description |
|---|---|
| bool | Returns True if the operation is successful, otherwise False. |
CreateGenericBinding(string, Type, string, bool, GenericBinding)
Retrieves the GenericBinding that represents a specific property associated with a GameObject or one of its components.
public static bool CreateGenericBinding(string path, Type componentType, string property, bool isObjectReference, out GenericBinding genericBinding)
Parameters
The path of the game object or component being animated.
The type of the component being animated.
The name of the property.
Specifies whether the property is an object reference. If you do not identify the property correctly, the method fails. Set this parameter to True if the property references an object. Set to False if the property is a float or an integer.
Returns the GenericBinding representing the property on the GameObject to animate.
Returns
Type | Description |
|---|---|
| bool | Returns True if the operation is successful, otherwise False. |