diff --git a/AASBufferFix/AASBufferFix.cs b/AASBufferFix/AASBufferHelper.cs similarity index 97% rename from AASBufferFix/AASBufferFix.cs rename to AASBufferFix/AASBufferHelper.cs index 3fd085e..a71098c 100644 --- a/AASBufferFix/AASBufferFix.cs +++ b/AASBufferFix/AASBufferHelper.cs @@ -3,7 +3,7 @@ using UnityEngine; namespace NAK.Melons.AASBufferFix; -public class AASBufferFix : MonoBehaviour +public class AASBufferHelper : MonoBehaviour { public bool isAcceptingAAS = true; @@ -74,12 +74,14 @@ public class AASBufferFix : MonoBehaviour { isAcceptingAAS = true; puppetMaster?.ApplyAdvancedAvatarSettings(aasBufferFloat, aasBufferInt, aasBufferByte); + Destroy(this); } public void ApplyExternalAAS(float[] settingsFloat, int[] settingsInt, byte[] settingsByte) { isAcceptingAAS = true; puppetMaster?.ApplyAdvancedAvatarSettings(settingsFloat, settingsInt, settingsByte); + Destroy(this); } public void StoreExternalAASBuffer(float[] settingsFloat, int[] settingsInt, byte[] settingsByte) diff --git a/AASBufferFix/HarmonyPatches.cs b/AASBufferFix/HarmonyPatches.cs index 6db6cfa..42029c0 100644 --- a/AASBufferFix/HarmonyPatches.cs +++ b/AASBufferFix/HarmonyPatches.cs @@ -13,7 +13,7 @@ internal class HarmonyPatches [HarmonyPatch(typeof(PuppetMaster), "Start")] private static void Postfix_PuppetMaster_Start(ref PuppetMaster __instance) { - AASBufferFix externalBuffer = __instance.AddComponentIfMissing(); + AASBufferHelper externalBuffer = __instance.AddComponentIfMissing(); externalBuffer.puppetMaster = __instance; } @@ -21,7 +21,7 @@ internal class HarmonyPatches [HarmonyPatch(typeof(PuppetMaster), "AvatarInstantiated")] private static void Postfix_PuppetMaster_AvatarInstantiated(ref PuppetMaster __instance, ref Animator ____animator) { - AASBufferFix externalBuffer = __instance.GetComponent(); + AASBufferHelper externalBuffer = __instance.GetComponent(); if (externalBuffer != null) externalBuffer.OnAvatarInstantiated(____animator); } @@ -29,7 +29,7 @@ internal class HarmonyPatches [HarmonyPatch(typeof(PuppetMaster), "AvatarDestroyed")] private static void Postfix_PuppetMaster_AvatarDestroyed(ref PuppetMaster __instance) { - AASBufferFix externalBuffer = __instance.GetComponent(); + AASBufferHelper externalBuffer = __instance.GetComponent(); if (externalBuffer != null) externalBuffer.OnAvatarDestroyed(); } @@ -37,7 +37,7 @@ internal class HarmonyPatches [HarmonyPatch(typeof(PuppetMaster), "ApplyAdvancedAvatarSettings")] private static bool Prefix_PuppetMaster_ApplyAdvancedAvatarSettings(float[] settingsFloat, int[] settingsInt, byte[] settingsByte, ref PuppetMaster __instance) { - AASBufferFix externalBuffer = __instance.GetComponent(); + AASBufferHelper externalBuffer = __instance.GetComponent(); if (externalBuffer != null && !externalBuffer.isAcceptingAAS) { externalBuffer.OnApplyAAS(settingsFloat, settingsInt, settingsByte); @@ -50,7 +50,7 @@ internal class HarmonyPatches [HarmonyPatch(typeof(CVRAnimatorManager), "ApplyAdvancedAvatarSettingsFromBuffer")] private static bool Prefix_PuppetMaster_ApplyAdvancedAvatarSettingsFromBuffer(ref Animator ____animator) { - AASBufferFix externalBuffer = ____animator.GetComponentInParent(); + AASBufferHelper externalBuffer = ____animator.GetComponentInParent(); if (externalBuffer != null && !externalBuffer.isAcceptingAAS) { //dont apply if stable buffer no exist diff --git a/AASBufferFix/Main.cs b/AASBufferFix/Main.cs index 6501c23..c81ebb8 100644 --- a/AASBufferFix/Main.cs +++ b/AASBufferFix/Main.cs @@ -6,6 +6,6 @@ public class AASBufferFixMod : MelonMod { public override void OnInitializeMelon() { - + //boobs } } \ No newline at end of file