Turn methods and properties into commands, and execute them right in the editor console & in-game.
Ghost Commands is available on the asset store!
HIGHLIGHTS
- Turn any method or property into a command
- Debug functionality inside the game at ease
- Enhance the editor with commands like managing assets and loading scenes
- Integrated command field within the editor console & game
- Group commands together with prefixes
- Supports static and non-static methods & properties
- Fully supported method overloads & default parameters
- Add and remove commands dynamically at runtime
- Modern UI built with UI Toolkit and style sheets
- Suggestions and auto-completion with intuitive keyboard navigation
- Highly customizable with style sheets
- Supports both legacy and new input system out of the box
Use the [Command] attribute on any method or property, and execute them directly in the editor console & in-game. No setup is required!
Version 1.1.0 is now available:
- Most types that derive from UnityEngine.Object are now supported out of the box
- Added new [Prefab] attribute to specify prefab commands & parameters
- Added new [Suggestor] attribute to easily create suggestions based on a type
- Added setting to automatically add prefixes to non-static commands
- Added setting to select which editor window to show the command field on
- Added new icons and tweaked some icon colors
- Added 6 new object commands
- Added custom assembly definitions
- Improved colors for light-mode editor UI
- Fixed a bug where the text field would sometimes disappear
- Fixed a bug with extracting containers from strings
- Fixed a bug with reading string arguments inside containers
- Small optimizations to the suggestion list
Version 1.2.0 is now available:
- Added new commands (More info here):
- Added new copy commands
- Added new build commands
- Added new object
- Added new name commands
- Fixed possible exception when attempting to build
- Added 2 new icons
Hi, is there any convenient way to set the size of the console? On on High DPI display the font size is quite small by default, and setting the text-size in USS doesn’t actually expand the UI, because item height is hardcoded in C#.
Otherwise, the asset is good so far. I appreciate that it’s not tightly tied to Monobehaviors because we use ECS!
The issue with font size not expanding the UI is definitely an oversight on our part. It has been fixed in a newer version of the asset that we are currently working on.
Glad to hear it’s working out for your ECS project! 
Great, looking forward to it!
I’ve also noticed that the plugin doesn’t support Nullable types. This would be really helpful for things like overrides, ie: [Command] public int? OverrideLevel;
Or do you have a suggestion on a better pattern for settable flags that have an additional ‘not set’ state? (-1 in this case is a valid level).
The Converter API nearly works. This is functional, but throws an error in the suggestion list file because it’s not expecting a valid value to ever be null.
Converter:
[Converter]
public static int? PersonTypeConverter(ArgumentReader reader)
{
if (reader.IsNextNumeric())
{
return reader.Read<int>();
}
var text = reader.Read<string>();
if (text == "null")
{
return null;
}
throw new Exception($"Couldn't parse argument. Expected 'int | null'. Got: [{text}]");
}
[Suggestor(typeof(int?))]
public static string[] NullableIntSuggestor(CommandInfo.Parameter parameter)
{
return new []
{
"null",
"0",
"1",
"10"
};
}
The fix is in SuggestionList.cs:
@@ -238,5 +238,5 @@
default:
- valueLabel.text = response.ToString();
+ valueLabel.text = response == null ? "null" : response.ToString();
break;
}
Thanks for pointing that out! We’ll also look into supporting nullable types! 