Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


SerializeReferenceCurve(string, Type, long, string, bool, bool)

Creates a preconfigured binding for a curve that points to a SerializeReference instance field.
Read time 1 minuteLast updated 10 days ago

Definition

  • Type: Method
  • Namespace: UnityEditor
  • Assembly: UnityEditor.CoreModule
public static EditorCurveBinding SerializeReferenceCurve(string inPath, Type inType, long refID, string inPropertyName, bool isPPtr, bool isDiscrete)

Parameters

inPath

The transform path to the object to animate.

inType

The type of the MonoBehaviour managing the SerializeReference instance to animate.

refID

The reference id of the SerializeReference instance to animate. Additional Resources: ManagedReferenceUtility.GetManagedReferenceIdForObject.

inPropertyName

The name of the property to animate on the object.

isPPtr

If true, the binding represents an object reference curve.

isDiscrete

If true, the binding represents a discrete value curve. Enabled by default if %%isPPtr%% is true.

Returns

Type

Description

EditorCurveBindingThe new EditorCurveBinding.

Remarks

Fields on objects referenced with SerializeReference can be animated when the host object is derived from MonoBehaviour. The animation binding to the referenced object will be based on the reference id instead of the property path, which makes it possible to correctly resolve the animation even when there are changes in the path leading to the referenced object. For example, if the object is referenced from within an array, the animation is retained even if the position of the object within the array changes.