Class SplineTool
Base class from which all Spline tools inherit. Inherit SplineTool to author tools that behave like native spline tools. This class implements some common functionality and shortcuts specific to spline authoring.
Inherited Members
Namespace: UnityEditor.Splines
Syntax
public abstract class SplineTool : EditorTool, IEditor
Properties
activeTool
The current active SplineTool in use.
Declaration
protected static SplineTool activeTool { get; }
Property Value
Type | Description |
---|---|
SplineTool |
handleOrientation
The current orientation of the handles for the current spline tool.
Declaration
public static HandleOrientation handleOrientation { get; set; }
Property Value
Type | Description |
---|---|
HandleOrientation |
handleRotation
The current rotation of the handle regarding the selection and the Handle Rotation configuration.
Declaration
public static Quaternion handleRotation { get; }
Property Value
Type | Description |
---|---|
Quaternion |
pivotPosition
The current position of the pivot regarding the selection.
Declaration
public static Vector3 pivotPosition { get; }
Property Value
Type | Description |
---|---|
Vector3 |
Methods
OnActivated()
Invoked after this EditorTool becomes the active tool.
Declaration
public override void OnActivated()
Overrides
OnHandleOrientationChanged()
Callback invoked when the handle rotation configuration changes.
Declaration
protected virtual void OnHandleOrientationChanged()
OnPivotModeChanged()
Callback invoked when the pivot mode configuration changes.
Declaration
protected virtual void OnPivotModeChanged()
OnWillBeDeactivated()
Invoked before this EditorTool stops being the active tool.
Declaration
public override void OnWillBeDeactivated()
Overrides
UpdateHandleRotation()
Updates the current handle rotation. This is usually called internally by callbacks. UpdateHandleRotation can be called to refresh the handle rotation after manipulating spline elements, for instance, such as rotating a knot.
Declaration
public static void UpdateHandleRotation()
UpdatePivotPosition(Boolean)
Updates current pivot position, usually called internally by callbacks. It can be called to refresh the pivot position after manipulating spline elements, for instance, such as moving a knot.
Declaration
public static void UpdatePivotPosition(bool useKnotPositionForTangents = false)
Parameters
Type | Name | Description |
---|---|---|
Boolean | useKnotPositionForTangents | Set to true to use the knots positions to compute the pivot instead of the tangents ones. This is necessary for some tools where it is preferrable to represent the handle on the knots rather than on the tangents directly. For instance, rotating a tangent is more intuitive when the handle is on the knot. |