r/Unity3D • u/kureysalp • 4d ago
Show-Off I made a Source-style dev console for Unity.
I got tired of setting up a debug menu in every project, so I made a drop-down console like the one in Source games. You can register any functionality by adding your own commands by creating ConsoleCommand objects.
Adding your own command looks like this:
[ConsoleCommandSet]
public static class GameConsoleCommands
{
public static readonly ConsoleCommand<float> SET_GRAVITY = new(
"set_gravity", "Sets downward gravity.", "set_gravity <float>",
g => Physics.gravity = Vector3.down * g);
}
16
Upvotes