Class SplineGUILayout
Provides IMGUI controls to edit Spline data.
Inherited Members
Namespace: UnityEditor.Splines
Assembly: Unity.Splines.Editor.dll
Syntax
public static class SplineGUILayout
Methods
EmbeddedSplineDataField(GUIContent, SplineContainer, int, EmbeddedSplineDataType, string)
Creates a field for an embedded SplineData<T> property. Embedded SplineData<T> is stored in the Spline class and can be accessed through a string key value. Use this function to expose an embedded SplineData<T> through the Inspector.
Declaration
public static bool EmbeddedSplineDataField(GUIContent label, SplineContainer container, int index, EmbeddedSplineDataType type, string key)
Parameters
Type | Name | Description |
---|---|---|
GUIContent | label | An optional prefix label. |
SplineContainer | container | The SplineContainer that holds the Spline target. |
int | index | |
EmbeddedSplineDataType | type | The EmbeddedSplineDataType type of data stored in the embedded SplineData<T> |
string | key | A string value used to identify and access embedded SplineData<T>. |
Returns
Type | Description |
---|---|
bool | True if the property has children, is expanded, and includeChildren was set to false. Returns false otherwise. |
EmbeddedSplineDataField(SplineContainer, int, EmbeddedSplineDataType, string)
Creates a field for an embedded SplineData<T> property. Embedded SplineData<T> is stored in the Spline class and can be accessed through a string key value. Use this function to expose an embedded SplineData<T> through the Inspector.
Declaration
public static bool EmbeddedSplineDataField(SplineContainer container, int index, EmbeddedSplineDataType type, string key)
Parameters
Type | Name | Description |
---|---|---|
SplineContainer | container | The SplineContainer that holds the Spline target. |
int | index | |
EmbeddedSplineDataType | type | The EmbeddedSplineDataType type of data stored in the embedded SplineData<T> |
string | key | A string value used to identify and access embedded SplineData<T>. |
Returns
Type | Description |
---|---|
bool | True if the property has children, is expanded, and includeChildren was set to false. Returns false otherwise. |
SplineIndexField(SerializedProperty, int)
Creates a dropdown to select an index between 0 and .
Declaration
public static void SplineIndexField(SerializedProperty property, int splineCount)
Parameters
Type | Name | Description |
---|---|---|
SerializedProperty | property | A SerializedProperty that stores an integer value. |
int | splineCount | The number of splines available. In most cases, this is the size of Splines |
Exceptions
Type | Condition |
---|---|
ArgumentException | An exception is thrown if is not an integer field. |
SplineIndexField<T>(SerializedProperty, T)
Creates a dropdown to select an index between 0 and the count of UnityEditor.Splines contained in the provided .
Declaration
public static void SplineIndexField<T>(SerializedProperty property, T container) where T : ISplineContainer
Parameters
Type | Name | Description |
---|---|---|
SerializedProperty | property | A SerializedProperty that stores an integer value. |
T | container | A SplineContainer that determines how many splines are available in the popup selector. |
Type Parameters
Name | Description |
---|---|
T | The type implementing ISplineContainer. |
Exceptions
Type | Condition |
---|---|
ArgumentException | An exception is thrown if is not an integer field. |
SplineIndexPopup(string, int, int)
Creates a dropdown to select an index between 0 and .
Declaration
public static int SplineIndexPopup(string label, int index, int splineCount)
Parameters
Type | Name | Description |
---|---|---|
string | label | An optional prefix label. |
int | index | The current index. |
int | splineCount | The number of splines available. In most cases, this is the size of Splines |
Returns
Type | Description |
---|---|
int | The selected index. |
SplineIndexPopup<T>(string, int, T)
Creates a dropdown to select a spline index relative to .
Declaration
public static int SplineIndexPopup<T>(string label, int index, T container) where T : ISplineContainer
Parameters
Type | Name | Description |
---|---|---|
string | label | An optional prefix label. |
int | index | The current index. |
T | container | A SplineContainer that determines how many splines are available in the popup selector. |
Returns
Type | Description |
---|---|
int | The selected index. |
Type Parameters
Name | Description |
---|---|
T | The type of ISplineContainer. |