Repository navigation
Commands
Elias Wennerberg edited this page Oct 4, 2026
·
3 revisions
[ConsoleCommand("coins", Description = "Grants coins.", Flags = CommandFlags.Cheat)]
public static void CoinsCommand(Action<string, bool> response, int amount = 250)-
Name (
"coins") plus optionalGroup("application.quit"style:Group = "application"). -
Response callback (optional, first parameter):
Action<string>,Action<string, bool>, orCommandResponseDelegate. Skipped for argument indexing in help and autocomplete. -
Arguments: any convertible type,
paramsarrays, optional defaults.
None, DebugOnly (debug builds only), EditorOnly, Cheat (needs UniTerminal.CheatsEnabled, toggled by the built-in enablecheats command), Hidden (excluded from help), Mod.
[ConsoleCommand("help", Description = "...")]
[CommandAlias("h")]UniTerminal.RegisterArgConverter<FoodId>(s => new FoodId(s));After that, any FoodId parameter parses from a string automatically.
UniTerminal.ExecuteCommand("coins 500");
UniTerminal.Log("Hello console.");help [command], clear, toggleUnityLogs, plus optional packs (time scale, graphics, physics, prefs, system info) toggled in Tools → UniTerminal → UniTerminal Window.
[ConsoleCommand("wave", Description = "Reports the current wave number.")]
public static void WaveCommand(CommandResponseDelegate response)
{
var waves = Object.FindFirstObjectByType<WaveManager>();
response(waves != null ? $"Wave {waves.WaveNumber}." : "No WaveManager in scene.", waves != null);
}Grouped command with an alias and a params array:
[ConsoleCommand("give", Description = "Gives items.", Group = "inventory")]
[CommandAlias("g")]
public static void GiveCommand(CommandResponseDelegate reply, params string[] items)
{
foreach (string item in items)
Inventory.Add(item);
reply($"Gave {items.Length} item(s).");
}Instance command — resolves a scene object instead of a static:
public class Shovel : MonoBehaviour
{
[ConsoleCommand("beds", Description = "Reports garden bed usage.")]
public void BedsCommand(CommandResponseDelegate response)
{
response($"Beds: {BedCount} / {maxBeds}.", true);
}
}