EditorCommands

Internal static class providing built-in editor commands for the Command System. Demonstrates the [EditorCommand] attribute pattern — each static method becomes a discoverable, executable command available in the CommandToolbar while in the editor (not restricted to play mode).

Definition

Namespace: Paragon.Core.Command.Editor Assembly: Paragon.Editor.dll

[UsedImplicitly]
internal static class EditorCommands

Remarks

This class is marked [UsedImplicitly] (JetBrains annotation) to suppress "unused" warnings, since the methods are discovered and invoked via reflection by the CommandProvider.

Each method uses the [EditorCommand] attribute, which is a convenience subclass of [Command] with RuntimeOnly = false. Since no explicit name is provided, the command name is the method name itself (e.g., EnterPlayMode, ExitPlayMode).

Commands

EnterPlayMode

Enters Unity play mode if not already playing.

[EditorCommand]
static void EnterPlayMode()

Command name: EnterPlayMode Guard: Only executes if EditorApplication.isPlaying is false.

ExitPlayMode

Exits Unity play mode if currently playing.

Command name: ExitPlayMode Guard: Only executes if EditorApplication.isPlaying is true.

Examples

Adding a Custom Editor Command

See Also

Last updated