mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-01-01 20:25:07 +08:00
8d3da50b37
* chore: migrate Scale Adjuster to NDMF preview system * feat: MA Shape Changer * chore: update NDMF dependency * fix: unit test failure
39 lines
876 B
C#
39 lines
876 B
C#
#region
|
|
|
|
using System;
|
|
using HarmonyLib;
|
|
using UnityEditor;
|
|
using UnityEngine;
|
|
|
|
#endregion
|
|
|
|
namespace nadena.dev.modular_avatar.core.editor.HarmonyPatches
|
|
{
|
|
internal class PatchLoader
|
|
{
|
|
private static readonly Action<Harmony>[] patches = new Action<Harmony>[]
|
|
{
|
|
//HierarchyViewPatches.Patch,
|
|
};
|
|
|
|
[InitializeOnLoadMethod]
|
|
static void ApplyPatches()
|
|
{
|
|
var harmony = new Harmony("nadena.dev.modular_avatar");
|
|
|
|
foreach (var patch in patches)
|
|
{
|
|
try
|
|
{
|
|
patch(harmony);
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
Debug.LogException(e);
|
|
}
|
|
}
|
|
|
|
AssemblyReloadEvents.beforeAssemblyReload += () => { harmony.UnpatchAll(); };
|
|
}
|
|
}
|
|
} |