Referencing the source
Using singletons and performing Harmony patching is great, but how do you actually figure out what singletons are available to you and what methods within those singletons or other classes can be patched?
dnSpy
dnSpy is a great tool which allows you to inspect the contents of an assembly. It offers a lot more than just inspecting assemblies, but for our purposes, this is all we need.
Download & extract dnSpy to a directory of your choosing
Launch the
dnSpy.exe
At the top left, click on
File
, thenOpen
and open aPuck.dll
in yourlibs
folder of your mod.
You can now look through the Puck.dll
and observe all types and classes used by Puck. Not only that, but you can also see a minimally obfuscated representation of the Puck source code. Having understanding of the code that runs Puck will be beneficial in creating more advanced mods which change some core logic of the game.
Last updated