public record class SceneToolSomething you can be doing in the viewport, offered inside whatever mode is active.
Remarks
Finer than an IEditorMode, and the distinction is Unity's. A mode is a statement about what a click means globally — Select, Terrain, Foliage — and there are a handful. A tool is one of the things you can be doing inside one, scoped to what is selected, and there are as many as the selection has verbs. Making every tool a mode is how a mode bar becomes a toolbar with a worse name.
⚠ The pane offers the active tool first refusal before the mode gets it. A tool is the more specific claim: it was chosen for this selection, where the mode was chosen for the session. ActiveTool is what sets one, and it is deliberately the pane's rather than the shell's — two panes side by side can be in different tools the way they are already in different view modes.
Fields and properties (5)
public string IdWhat everything refers to it by. Prefix a plugin's with the plugin's own id.
public string TitleWhat its button says.
public IViewportInput InputWhat gets the pane's input while the tool is the active one.
public Type? TargetThe component type that has to be on the selection for the tool to be offered, or for a tool that always applies. Read by whatever draws the tool strip; the pane itself does not filter, because it does not know what a component is.
public int OrderWhere among the tools, low first. Ties keep registration order.
Methods (1)
public SceneTool(string Id, string Title, IViewportInput Input, Type? Target = null, int Order = 0)Something you can be doing in the viewport, offered inside whatever mode is active.
Used by (4)
- DeclaredContributionTestsVixen.Editor.App.Tests
- DeclaredContributionsVixen.Editor.App
- OutOfTreePluginTestsVixen.Editor.App.Tests
- SceneViewportVixen.Editor.SceneView