- Added docs/CODE_ANALYSIS_PHASE2.md with deep analysis - Implemented VoiceManagerPatch: voice limit (128), ducking, fade times - Implemented AudioDuckingPatch: snapshot apply, fade in/out timing - Implemented EnemyAudioPatch: enemy attack hooks, CFVoice routing - Updated Plugin.cs to call all patch Apply methods - Hook targets: UtageFmodVoiceManager, SnapshotManager, CFVoiceEventUtility
51 lines
1.4 KiB
C#
51 lines
1.4 KiB
C#
using BepInEx;
|
|
using BepInEx.Logging;
|
|
using HarmonyLib;
|
|
|
|
namespace HomuraHimeAudioMod
|
|
{
|
|
[BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)]
|
|
public class Plugin : BaseUnityPlugin
|
|
{
|
|
public const string PLUGIN_GUID = "com.homurahime.audiomod";
|
|
public const string PLUGIN_NAME = "HomuraHime Audio Mod";
|
|
public const string PLUGIN_VERSION = "1.0.0";
|
|
|
|
private static Plugin instance;
|
|
private static ManualLogSource logger;
|
|
private Harmony harmony;
|
|
|
|
public static ManualLogSource Log => logger;
|
|
|
|
private void Awake()
|
|
{
|
|
instance = this;
|
|
logger = Logger;
|
|
|
|
harmony = new Harmony(PluginInfo.PLUGIN_GUID);
|
|
|
|
Log.LogInfo($"HomuraHime Audio Mod v{PluginInfo.PLUGIN_VERSION} initializing...");
|
|
|
|
ApplyPatches();
|
|
|
|
Log.LogInfo("HomuraHime Audio Mod initialized successfully");
|
|
}
|
|
|
|
private void ApplyPatches()
|
|
{
|
|
Log.LogInfo("Applying audio patches...");
|
|
|
|
VoiceManagerPatch.Apply(ref harmony);
|
|
AudioDuckingPatch.Apply(ref harmony);
|
|
EnemyAudioPatch.Apply(ref harmony);
|
|
|
|
Log.LogInfo("All patches applied successfully");
|
|
}
|
|
|
|
private void OnDestroy()
|
|
{
|
|
harmony?.UnpatchAll(PluginInfo.PLUGIN_GUID);
|
|
}
|
|
}
|
|
}
|