Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of Effective Audio v1.0.2
SfxAdder.dll
Decompiled a year agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using HarmonyLib; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("SfxAdder")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("SfxAdder")] [assembly: AssemblyCopyright("Copyright © 2025")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("dda506ea-ccd0-441f-9bbf-5f585254bc83")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] [BepInPlugin("BitterDoes.EffectiveAudio", "Effective Audio", "1.0.2")] public class EchoReverbMod : BaseUnityPlugin { [HarmonyPatch(typeof(AudioSource))] public class EchoReverbPatches { private static readonly HashSet<string> musicTags = new HashSet<string> { "ambience", "arena", "camera", "explosion", "music", "menu", "sighting" }; [HarmonyPatch("Play", new Type[] { })] [HarmonyPrefix] public static void PrefixPlay(AudioSource __instance) { ApplyFilters(__instance); } [HarmonyPatch("PlayOneShot", new Type[] { typeof(AudioClip) })] [HarmonyPrefix] public static void PrefixPlayOneShot(AudioSource __instance, AudioClip clip) { ApplyFilters(__instance); } private static void ApplyFilters(AudioSource source) { //IL_00f6: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)source == (Object)null || !((Behaviour)source).enabled) { return; } string text = (((Object)(object)source.clip != (Object)null) ? ((Object)source.clip).name.ToLowerInvariant() : ""); bool flag = false; if (!string.IsNullOrEmpty(text)) { foreach (string musicTag in musicTags) { if (text.Contains(musicTag) && !text.Contains("musicbox")) { flag = false; break; } flag = true; } } if (flag && EnableReverb.Value && !Object.op_Implicit((Object)(object)((Component)source).GetComponent<AudioReverbFilter>())) { AudioReverbFilter val = ((Component)source).gameObject.AddComponent<AudioReverbFilter>(); val.reverbPreset = ReverbPreset.Value; } } } [HarmonyPatch(typeof(AudioSource))] [HarmonyPatch("Play")] public class AudioPatch { private static void Postfix(AudioSource __instance) { if ((Object)(object)Instance != (Object)null) { Instance.OnAudioSourcePlayed(__instance); } } } public static ConfigEntry<bool> EnableReverb; public static ConfigEntry<AudioReverbPreset> ReverbPreset; public static EchoReverbMod Instance { get; private set; } private void Awake() { Instance = this; EnableReverb = ((BaseUnityPlugin)this).Config.Bind<bool>("Reverb", "EnableReverb", true, "Enable or disable the reverb filter."); ReverbPreset = ((BaseUnityPlugin)this).Config.Bind<AudioReverbPreset>("Reverb", "Preset", (AudioReverbPreset)15, "Choose a reverb preset."); Harmony.CreateAndPatchAll(typeof(EchoReverbPatches), (string)null); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Echo Reverb Mod with Configs loaded."); } public void OnAudioSourcePlayed(AudioSource source) { if (!((Object)(object)source == (Object)null) && (Object)(object)((Component)source).gameObject.GetComponent<AudioReverbFilter>() == (Object)null) { AudioReverbFilter val = ((Component)source).gameObject.AddComponent<AudioReverbFilter>(); val.reverbPreset = (AudioReverbPreset)13; } } }