From 4b9d1128c6f8b8fb233669ad7eb86e99a2078bde Mon Sep 17 00:00:00 2001 From: bd_ Date: Tue, 1 Oct 2024 20:09:47 -0700 Subject: [PATCH] chore: set harmony ID on UnpatchAll call --- Editor/HarmonyPatches/PatchLoader.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Editor/HarmonyPatches/PatchLoader.cs b/Editor/HarmonyPatches/PatchLoader.cs index 0ce7ffa4..b368fca7 100644 --- a/Editor/HarmonyPatches/PatchLoader.cs +++ b/Editor/HarmonyPatches/PatchLoader.cs @@ -11,6 +11,8 @@ namespace nadena.dev.modular_avatar.core.editor.HarmonyPatches { internal class PatchLoader { + private const string HarmonyId = "nadena.dev.modular_avatar"; + private static readonly Action[] patches = new Action[] { //HierarchyViewPatches.Patch, @@ -19,7 +21,7 @@ namespace nadena.dev.modular_avatar.core.editor.HarmonyPatches [InitializeOnLoadMethod] static void ApplyPatches() { - var harmony = new Harmony("nadena.dev.modular_avatar"); + var harmony = new Harmony(HarmonyId); foreach (var patch in patches) { @@ -33,7 +35,7 @@ namespace nadena.dev.modular_avatar.core.editor.HarmonyPatches } } - AssemblyReloadEvents.beforeAssemblyReload += () => { harmony.UnpatchAll(); }; + AssemblyReloadEvents.beforeAssemblyReload += () => { harmony.UnpatchAll(HarmonyId); }; } } } \ No newline at end of file