** A small library that can be used to quicky create BepInEx 5 plugins for Unity **
This project is designed to allow developers to quickly create BepInEx 5 plugins for Unity games. It provides a simple way to create a plugin that can be easily loaded into the game.
- Use the NuGet package manager to install the package
- Ensure that Paulov.Bepinex.Framework.dll is in the game's BepinEx/plugins folder
- In your Plugin class,
Awake
method, add the following code to load the Framework.
var assembly = Assembly.LoadFile(Path.Combine(ReflectionHelpers.GetBaseDirectory(), "BepInEx", "plugins", "Paulov.Bepinex.Framework.dll"));
if (Assembly.UnsafeLoadFrom(assembly.Location) != null)
Logger.LogInfo("Loaded Paulov.Bepinex.Framework.dll");
- Create a new class that inherits from
IPaulovHarmonyPatch
orNullPaulovHarmonyPatch
- Patch your desired method using the correct method (i.e. Prefix, Postfix, etc.)
- In your Plugin class,
Awake
method, Instantiate theHarmonyPatchManager
class and call theEnablePatches
method with the class you created
var harmonyPatchManager = new Paulov.Bepinex.Framework.HarmonyPatchManager("Paulov's Main Harmony Manager");
harmonyPatchManager.EnablePatches();
To learn more about patching using Harmony, visit the Harmony Wiki
Distributed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. See LICENSE for more information.