-
Notifications
You must be signed in to change notification settings - Fork 0
Using Harmony
devilExE edited this page Feb 5, 2024
·
1 revision
Generally speaking, simple mods don't need Harmony, that's why it's not included by default in the MDK.
If you want to use Harmony (which is also used by Loadson internally), follow this steps:
- Install
Lib.Harmonyversion 2.2.2 via NuGet - Open Project (not Solution) properties, and go to Build Events
- In the Post-Build commands insert
del 0Harmony*below the otherdellines. It should look like:
echo Cleaning bin folder..
del Assembly-CSharp.dll
del LoadsonAPI.*
del Unity*
del 0Harmony*
"$(SolutionDir)ModBuilder.exe"
- In your
OnEnable()method add the following lines:
HarmonyLib.Harmony harmony = new HarmonyLib.Harmony("<guid>");
harmony.PatchAll();Where <guid> is your namespace name (aka GUID)
For learning how to use Harmony, this is a great start