mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-01-06 14:45:06 +08:00
e06e83daba
Harmony patches were not being loaded for VRCSDK 3.4.x, causing some issues with component enabled state checkboxes being incorrect. Additionally, we need to reset component states before assembly reload and scene save.
39 lines
883 B
C#
39 lines
883 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>[]
|
|
{
|
|
SnoopHeaderRendering.Patch1,
|
|
SnoopHeaderRendering.Patch2,
|
|
HideScaleAdjusterFromPrefabOverrideView.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);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |