12345678910111213141516171819202122232425262728293031 |
- using HarmonyLib;
- using IPA.Utilities;
- namespace BeatSaberTweakers.VolumeAdjust.HarmonyPatches
- {
- [HarmonyPatch(typeof(EffectPoolsManualInstaller), "ManualInstallBindings")]
- internal static class EffectPoolsManualInstallerPatch
- {
- private static readonly FieldAccessor<EffectPoolsManualInstaller, NoteCutSoundEffect>.Accessor GetNoteCutSoundEffect = FieldAccessor<EffectPoolsManualInstaller, NoteCutSoundEffect>.GetAccessor("_noteCutSoundEffectPrefab");
- private static readonly FieldAccessor<NoteCutSoundEffect, float>.Accessor GetGoodCutVolume = FieldAccessor<NoteCutSoundEffect, float>.GetAccessor("_goodCutVolume");
- private static readonly FieldAccessor<NoteCutSoundEffect, float>.Accessor GetBadCutVolume = FieldAccessor<NoteCutSoundEffect, float>.GetAccessor("_badCutVolume");
- internal static void Prefix(EffectPoolsManualInstaller __instance)
- {
- var eff = GetNoteCutSoundEffect(ref __instance);
- var gc = GetGoodCutVolume(ref eff);
- var bc = GetBadCutVolume(ref eff);
- Plugin.Logger.Debug("EffectPoolsManualInstallerPatch original gc:" + gc + ", bc:" + bc);
- gc = 1;
- bc = 1;
- GetGoodCutVolume(ref eff) = gc;
- GetBadCutVolume(ref eff) = bc;
- Plugin.Logger.Debug("EffectPoolsManualInstallerPatch to gc:" + gc + ", bc:" + bc);
- }
- }
- }
|