internal static void RemoveHarmonyPatches() { try { // Removes all patches with this HarmonyId //harmony.UnpatchAll(HarmonyId); harmony.UnpatchSelf(); } catch (Exception ex) { Plugin.Log?.Error("Error removing Harmony patches: " + ex.Message); Plugin.Log?.Debug(ex); } }
internal static void Quit() { MelonHandler.OnApplicationQuit(); MelonPreferences.Save(); HarmonyInstance.UnpatchSelf(); bHaptics.Quit(); MelonLogger.Flush(); if (MelonLaunchOptions.Core.QuitFix) { Process.GetCurrentProcess().Kill(); } }
public void OnDisable() => Harmony.UnpatchSelf();