Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


ToolAttribute

Base class from which EditorToolAttribute and EditorToolContextAttribute inherit.
Read time 4 minutesLast updated 6 days ago

Definition

public abstract class ToolAttribute : Attribute

Static Fields

Value

Description

defaultPriorityThe default value for ToolAttribute.toolPriority and ToolAttribute.variantPriority. Specify a priority lower than this value to display a tool before the default entries, or specify a higher value to display it after the default entries.

Properties

Property

Description

allowPersistentTargetsAllows the tool to target persistent objects. This is only compatible with ScriptableObjects. When you develop tools that target persistent objects, let users know whether they're editing an in-scene or a persistent object.
displayNameThe name that displays in menus.
groupTool groups place logically similar tools under a single header in the Tools Overlay.
targetContextIf provided, the EditorTool will only be made available when the ToolManager.activeContextType is equal to ToolAttribute.targetContext.
targetTypeSet to the type that this EditorTool or EditorToolContext can edit. Set to null if the tool is not specific to a Component and should be available at any time.
toolPriorityTool priority defines the order that tools are displayed in within the Tools Overlay.
variantGroupTool variants are used to group logically similar tools into a single button in the Tools Overlay.
variantPriorityThe variant priority defines the order that tools are displayed in when they are displayed in a ToolAttribute.variantGroup dropdown.

Inheritance

Inherited Members