Class SplineToolContext
Defines a tool context for editing splines. When authoring tools for splines, pass the SplineToolContext type to the EditorToolAttribute.editorToolContext parameter to register as a spline tool.
Inherited Members
Namespace: UnityEditor.Splines
Syntax
[EditorToolContext("Spline", typeof(ISplineContainer))]
public sealed class SplineToolContext : EditorToolContext, IEditor
Properties
useCustomSplineHandles
Defines if the spline tool context draws the default handles for splines or if they are managed directly by the SplineTool
.
Set to false for SplineToolContext to draw the default spline handles for segments, knots, and tangents which you can directly manipulate. Set to true to draw handles and manage direct manipulation with your tool. The default value is false.
Declaration
public static bool useCustomSplineHandles { set; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
GetEditorToolType(Tool)
Returns the matching EditorTool type for the specified Tool given the context.
Declaration
protected override Type GetEditorToolType(Tool tool)
Parameters
Type | Name | Description |
---|---|---|
Tool | tool | The Tool to resolve to an EditorTool type. |
Returns
Type | Description |
---|---|
Type | An EditorTool type for the requested Tool. |
Overrides
OnActivated()
Invoked after this EditorToolContext becomes the active tool context.
Declaration
public override void OnActivated()
Overrides
OnToolGUI(EditorWindow)
Invoked for each window where this context is active. The spline context uses this method to implement common functionality for working with splines, ex gizmo drawing and selection.
Declaration
public override void OnToolGUI(EditorWindow window)
Parameters
Type | Name | Description |
---|---|---|
EditorWindow | window |
Overrides
OnWillBeDeactivated()
Invoked before this EditorToolContext stops being the active tool context.
Declaration
public override void OnWillBeDeactivated()