[BadAnimatorFix] Fixes for 2023r171

This commit is contained in:
NotAKidoS 2023-07-30 16:23:29 -05:00
parent d3db894acf
commit b20928c2b1
6 changed files with 17 additions and 40 deletions

View file

@ -6,7 +6,7 @@ using UnityEngine;
namespace NAK.BadAnimatorFix.HarmonyPatches;
static class AnimatorPatches
internal static class AnimatorPatches
{
[HarmonyPostfix]
[HarmonyPatch(typeof(PlayerSetup), nameof(PlayerSetup.Start))]
@ -31,24 +31,6 @@ static class AnimatorPatches
AddBadAnimatorFixComponentIfAnimatorExists(__instance.gameObject);
}
// Set QM stuff
[HarmonyPostfix]
[HarmonyPatch(typeof(CVR_MenuManager), nameof(CVR_MenuManager.Start))]
private static void Postfix_CVR_MenuManager_Start(ref CVR_MenuManager __instance)
{
if (!BadAnimatorFix.EntryMenus.Value) return;
AddBadAnimatorFixComponentIfAnimatorExists(__instance.gameObject);
}
// Set MM stuff
[HarmonyPostfix]
[HarmonyPatch(typeof(ViewManager), nameof(ViewManager.Start))]
private static void Postfix_ViewManager_Start(ref ViewManager __instance)
{
if (!BadAnimatorFix.EntryMenus.Value) return;
AddBadAnimatorFixComponentIfAnimatorExists(__instance.gameObject);
}
private static void AddBadAnimatorFixComponentIfAnimatorExists(GameObject gameObject)
{
Animator[] animators = gameObject.GetComponentsInChildren<Animator>(true);