mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2024-12-29 18:55:06 +08:00
chore: set harmony ID on UnpatchAll call
This commit is contained in:
parent
2c9939dea8
commit
4b9d1128c6
@ -11,6 +11,8 @@ namespace nadena.dev.modular_avatar.core.editor.HarmonyPatches
|
|||||||
{
|
{
|
||||||
internal class PatchLoader
|
internal class PatchLoader
|
||||||
{
|
{
|
||||||
|
private const string HarmonyId = "nadena.dev.modular_avatar";
|
||||||
|
|
||||||
private static readonly Action<Harmony>[] patches = new Action<Harmony>[]
|
private static readonly Action<Harmony>[] patches = new Action<Harmony>[]
|
||||||
{
|
{
|
||||||
//HierarchyViewPatches.Patch,
|
//HierarchyViewPatches.Patch,
|
||||||
@ -19,7 +21,7 @@ namespace nadena.dev.modular_avatar.core.editor.HarmonyPatches
|
|||||||
[InitializeOnLoadMethod]
|
[InitializeOnLoadMethod]
|
||||||
static void ApplyPatches()
|
static void ApplyPatches()
|
||||||
{
|
{
|
||||||
var harmony = new Harmony("nadena.dev.modular_avatar");
|
var harmony = new Harmony(HarmonyId);
|
||||||
|
|
||||||
foreach (var patch in patches)
|
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); };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user