Class EditorSplineUtility
Editor utility functions for working with Spline and SplineData<T>.
Inherited Members
Namespace: UnityEditor.Splines
Syntax
public static class EditorSplineUtility
Properties
DefaultTangentMode
Represents the default TangentMode used to place or insert knots. If the user does not define tangent handles, then the tangent takes the default TangentMode.
Declaration
public static TangentMode DefaultTangentMode { get; }
Property Value
Type | Description |
---|---|
TangentMode |
Methods
CopySplineDataIfEmpty(ISplineContainer, Int32, Int32, EmbeddedSplineDataType, String)
Copy an embedded SplineData<T> collection to a new Spline if the destination
does not already contain an entry matching the type
and key
.
Declaration
public static bool CopySplineDataIfEmpty(ISplineContainer container, int source, int destination, EmbeddedSplineDataType type, string key)
Parameters
Type | Name | Description |
---|---|---|
ISplineContainer | container | |
Int32 | source | The index of the Spline in the |
Int32 | destination | The index of the Spline in the |
EmbeddedSplineDataType | type | |
String | key | A string value used to identify and access a SplineData<T>. |
Returns
Type | Description |
---|---|
Boolean | True if data was copied, otherwise false. |
RegisterSplineDataChanged<T>(Action<SplineData<T>>)
Use this function to register a callback that gets invoked once per-frame if any SplineData<T> changes occur.
Declaration
public static void RegisterSplineDataChanged<T>(Action<SplineData<T>> action)
Parameters
Type | Name | Description |
---|---|---|
Action<SplineData<T>> | action | The callback to register. |
Type Parameters
Name | Description |
---|---|
T | The type parameter of SplineData<T>. |
SetKnotPlacementTool()
Sets the current active context to the SplineToolContext and the current active tool to the Draw Splines Tool (UnityEditor.Splines.KnotPlacementTool)
Declaration
public static void SetKnotPlacementTool()
UnregisterSplineDataChanged<T>(Action<SplineData<T>>)
Use this function to unregister SplineData<T> change callback.
Declaration
public static void UnregisterSplineDataChanged<T>(Action<SplineData<T>> action)
Parameters
Type | Name | Description |
---|---|---|
Action<SplineData<T>> | action | The callback to unregister. |
Type Parameters
Name | Description |
---|---|
T | The type parameter of SplineData<T>. |
Events
AfterSplineWasModified
Invoked once per-frame if a spline property has been modified.
Declaration
public static event Action<Spline> AfterSplineWasModified
Event Type
Type | Description |
---|---|
Action<Spline> |