Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

In game dev console for unity games

A topic by Phill created Jan 01, 2019 Views: 2,226
Viewing posts 1 to 1
(+4)


If you were interested in the dev console from Source games, then this console is pretty much that. GitHub link.

It finds all static methods, properties and fields marked with the [Command] attribute. Though it will also find any of those as instances too! As long as you register the instance that owns the command prior to calling. What this means, is that you can mark any static method, property or field with that attribute, and automatically expose it to the in-game dev console.

It's also useful on non-static commands as well (instance), for example, any player object, any pickup object or any script that is attached onto a game object. Like mentioned before, as long as the object is registered, you can then reference these objects with the @ prefix.

@player gun "super gun" - Changes the gun on your own player to the super gun
@boss gun "nerf pistol" - Changes the gun of the boss to a nerf pistol

The most common usecase for this console is of course debugging, quick dev cheats and even game bootstrapping. I personally use it in conjunction with networking code.

net host 16 25565
net kick user:5
net shutdown


Let me know if its easy enough to use, and if theres any suggestions or improvements. I work on this utility actively because it's something that I use in all of my games.

TLDR: Add a [Command] attribute to your static method/property/field and then call it from the console.