Add Audio Related VFX Support

This commit is contained in:
copecone committed 2026-06-10 16:40:30 +09:00
1 parent a17c867fba
commit 0a879cdafa
3 files changed
+277 -2

No files matched your search

+28 -1
View File
@@ -1,6 +1,8 @@
using System.Diagnostics.CodeAnalysis;
using ADOFAIRenderer.Core;
using ADOFAIRenderer.Util;
using HarmonyLib;
using MelonLoader;
using UnityEngine;
namespace ADOFAIRenderer.Patch.Engine
@@ -138,5 +140,30 @@ namespace ADOFAIRenderer.Patch.Engine
return false;
}
}
[HarmonyPatch(typeof(AudioSource), "GetSpectrumData", typeof(float[]), typeof(int), typeof(FFTWindow))]
public static class GetSpectrumDataPatch
{
[SuppressMessage("ReSharper", "InconsistentNaming")]
public static bool Prefix(AudioSource __instance, float[] samples, int channel, FFTWindow window)
{
if (!RenderManager.IsCapturingActive || !RenderPatch) return true;
AudioSpectrumGenerator.GetSpectrumData(samples, channel, window);
return false;
}
}
[HarmonyPatch(typeof(AudioManager), "FindOrLoadAudioClipExternal", typeof(string), typeof(bool), typeof(float), typeof(bool))]
public static class FindOrLoadAudioClipExternalPatch
{
[SuppressMessage("ReSharper", "InconsistentNaming")]
public static void Prefix(ref bool stream)
{
if (RenderManager.Instance != null)
{
stream = false;
}
}
}
}
}
}