Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


EventCommandNames

Names of the commands the Editor sends to its windows and controls, such as copy, paste, or delete.
Read time 2 minutesLast updated 4 days ago

Definition

  • Type: Class
  • Namespace: UnityEngine
  • Assembly: UnityEngine.UICommonModule
public static class EventCommandNames

Remarks

The Editor sends a command in two phases: a validation phase that asks whether anything handles the command, followed by an execution phase that performs it. Compare the command name against the constants in this class to handle these commands in custom Editor UI. In UI Toolkit, the phases are delivered as ValidateCommandEvent and ExecuteCommandEvent and the name is available through their commandName property. In IMGUI, they are delivered as events of type EventType.ValidateCommand and EventType.ExecuteCommand and the name is available through _commandName.
To indicate that a command is handled, call the event's StopPropagation method in UI Toolkit, or Event.Use in IMGUI, during the validation phase.

Static Fields

Value

Description

CopyThe command name for the Copy command, which copies the current selection to the clipboard.
CutThe command name for the Cut command, which copies the current selection to the clipboard and removes it.
DeleteThe command name for the Delete command, which removes the current selection.
DeselectAllThe command name for the Deselect All command, which clears the current selection.
DuplicateThe command name for the Duplicate command, which creates a copy of the current selection.
FindThe command name for the Find command, which moves focus to the search field of the current window.
FrameSelectedThe command name for the Frame Selected command, which centers the current view on the selection.
FrameSelectedWithLockThe command name for the Frame Selected With Lock command, which centers the current view on the selection and keeps following it when the selection moves.
InvertSelectionThe command name for the Invert Selection command, which selects the items that are not part of the current selection and deselects the items that are.
PasteThe command name for the Paste command, which inserts the clipboard content into the current context.
RenameThe command name for the Rename command, which starts renaming the current selection.
SelectAllThe command name for the Select All command, which selects every item in the current context.
SelectChildrenThe command name for the Select Children command, which extends the selection to the children of the currently selected items.
SelectPrefabRootThe command name for the Select Prefab Root command, which moves the selection to the root of the Prefab that contains the currently selected GameObject.
SoftDeleteThe command name for the Soft Delete command, which removes the current selection. The Editor sends this command instead of EventCommandNames.Delete when the Delete key is pressed without modifiers, so a handler can implement a less destructive removal, such as keeping references intact.
UndoRedoPerformedThe command name for the notification the Editor sends to its windows after an undo or redo operation completes, so they can refresh the state they display.