Game Modification: PC Building Simulator

He wanted things like "Infinite Money" and "Instant Level 20", since he didn't like to grind games. Sure, I get that. I often find myself opening Cheat Engine on many a game when I find the game get's a bit boring.

So I grabbed a copy of PCBS (PC Building Simulator) off Steam and set to work.

The first thing I did was quite simply peruse the directory structure, and I can immediatly see that the game has been created in Unity Engine, which is a .NET based game engine. This makes things a lot simpler, since it is possible to just decompile .NET binaries, or in this case, the .NET libraries that will contain the game logic.

Tools

dnSpy

I'm only going to use dnSpy for this game, since there is no need for any other tools.

Game Structure

The only thing that matters realted to this game, is that unity stores all libraries related to game logic within the <project_name>_Data\Managed folder.
In this case, the .\PCBS_Data\Managed folder.

The question is now, how the heck do we use it. Because it clearly isn't just available when you start a new game.

Enabling the debug menu

A quick analysis of the DebugMenu class in dnSpy points to a few interesting classes which use the DebugMenu class.

The GameController.ShowDebugMenu() method looks promising, and expanding it's Used By tree shows it is only used by a single class.

However, there is a bit of a problem now. GameController.ShowDebugMenu() is used by PCBuilder.DoPCBuilder(), however PCBuilder.DoPCBuilder() is only used by DebugMenu.OnGUI(). That doesn't help at all.

Doubling back to the inital Used By tree for the DebugMenu class points to something else that could be helpful: CommonUI.Awake().