Class InspectorCurveEditor
A custom curve editor made to be embedded in the inspector instead of a separate window.
Namespace: UnityEditor.Rendering
Syntax
public sealed class InspectorCurveEditor
Constructors
InspectorCurveEditor()
Creates a curve editor with default settings.
Declaration
public InspectorCurveEditor()
See Also
InspectorCurveEditor(InspectorCurveEditor.Settings)
Creates a curve editor with the given settings.
Declaration
public InspectorCurveEditor(InspectorCurveEditor.Settings settings)
Parameters
Type | Name | Description |
---|---|---|
InspectorCurveEditor.Settings | settings | The settings to use to create the curve editor. |
Fields
settings
The current settings used for the curve editor.
Declaration
public readonly InspectorCurveEditor.Settings settings
Field Value
Type | Description |
---|---|
InspectorCurveEditor.Settings |
Methods
Add(SerializedProperty)
Adds a serialized curve to the editor.
Declaration
public void Add(SerializedProperty curve)
Parameters
Type | Name | Description |
---|---|---|
SerializedProperty | curve | The curve to add. |
Add(SerializedProperty, InspectorCurveEditor.CurveState)
Adds a serialized curve to the editor with a given state.
Declaration
public void Add(SerializedProperty curve, InspectorCurveEditor.CurveState state)
Parameters
Type | Name | Description |
---|---|---|
SerializedProperty | curve | The curve to add. |
InspectorCurveEditor.CurveState | state | The state to use for the curve. |
Add(SerializedProperty[])
Adds an arbitrary number of serialized curves to the editor.
Declaration
public void Add(params SerializedProperty[] curves)
Parameters
Type | Name | Description |
---|---|---|
SerializedProperty[] | curves | The curves to add. |
GetCurveState(SerializedProperty)
Grabs the state for a given curve.
Declaration
public InspectorCurveEditor.CurveState GetCurveState(SerializedProperty curve)
Parameters
Type | Name | Description |
---|---|---|
SerializedProperty | curve | The curve to grab the state from. |
Returns
Type | Description |
---|---|
InspectorCurveEditor.CurveState | The state of the curve. |
GetSelection()
Gets the current selection.
Declaration
public InspectorCurveEditor.Selection GetSelection()
Returns
Type | Description |
---|---|
InspectorCurveEditor.Selection | The current selection. |
OnGUI(Rect)
Draws the curve editor. This is meant to be called in your custom editors.
Declaration
public bool OnGUI(Rect rect)
Parameters
Type | Name | Description |
---|---|---|
Rect | rect | The rectangle to draw into. |
Returns
Type | Description |
---|---|
Boolean |
|
Remove(SerializedProperty)
Removes a single curve from the editor.
Declaration
public void Remove(SerializedProperty curve)
Parameters
Type | Name | Description |
---|---|---|
SerializedProperty | curve | The curve to remove. |
RemoveAll()
Removes all the curve from the editor.
Declaration
public void RemoveAll()
SetCurveState(SerializedProperty, InspectorCurveEditor.CurveState)
Sets the state for a given curve.
Declaration
public void SetCurveState(SerializedProperty curve, InspectorCurveEditor.CurveState state)
Parameters
Type | Name | Description |
---|---|---|
SerializedProperty | curve | The curve to set the state of. |
InspectorCurveEditor.CurveState | state | The state to set for the curve. |
SetKeyframe(SerializedProperty, Int32, Keyframe)
Sets a key for a given curve.
Declaration
public void SetKeyframe(SerializedProperty curve, int keyframeIndex, Keyframe keyframe)
Parameters
Type | Name | Description |
---|---|---|
SerializedProperty | curve | The curve to modify. |
Int32 | keyframeIndex | The index of the key to set. |
Keyframe | keyframe | The new keyframe to put at the index. |