Class SplineGUILayout
Provides IMGUI controls to edit Spline data.
Inherited Members
Namespace: UnityEditor.Splines
Syntax
public static class SplineGUILayout
Methods
EmbeddedSplineDataField(GUIContent, SplineContainer, Int32, 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. |
Int32 | 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 |
---|---|
Boolean | True if the property has children, is expanded, and includeChildren was set to false. Returns false otherwise. |
EmbeddedSplineDataField(SplineContainer, Int32, 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. |
Int32 | 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 |
---|---|
Boolean | True if the property has children, is expanded, and includeChildren was set to false. Returns false otherwise. |
SplineIndexField(SerializedProperty, Int32)
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. |
Int32 | 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, Int32, Int32)
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. |
Int32 | index | The current index. |
Int32 | splineCount | The number of splines available. In most cases, this is the size of Splines |
Returns
Type | Description |
---|---|
Int32 | The selected index. |
SplineIndexPopup<T>(String, Int32, 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. |
Int32 | index | The current index. |
T | container | A SplineContainer that determines how many splines are available in the popup selector. |
Returns
Type | Description |
---|---|
Int32 | The selected index. |
Type Parameters
Name | Description |
---|---|
T | The type of ISplineContainer. |