Decompiled source of Music To Slay Monsters To v1.0.1

MusicMadness.dll

Decompiled a day ago
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using BepInEx;
using CustomWwiseSoundbanks;
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("MusicMadness")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MusicMadness")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("9934f149-9186-4070-848d-ad8f609a57f2")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.0.0")]
[BepInPlugin("cuttothechase.necropolis.custommusic", "Music To Slay Monsters To", "1.0.1")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class CustomMusicPlugin : BaseUnityPlugin
{
	private void Awake()
	{
		((MonoBehaviour)this).StartCoroutine(SetupMusic());
	}

	private IEnumerator SetupMusic()
	{
		while (!CustomWwiseAPI.IsReady)
		{
			yield return (object)new WaitForSeconds(0.5f);
		}
		while (!CustomWwiseAPI.IsBankLoaded("testmusic"))
		{
			yield return (object)new WaitForSeconds(0.5f);
		}
		while (!CustomWwiseAPI.IsBankLoaded("testenviromusic"))
		{
			yield return (object)new WaitForSeconds(0.5f);
		}
		Dictionary<MusicState, string> musicEvents = new Dictionary<MusicState, string>
		{
			{
				(MusicState)1,
				"Custom_Music_Title"
			},
			{
				(MusicState)2,
				"Custom_Music_Explore"
			},
			{
				(MusicState)3,
				"Custom_Music_Combat"
			}
		};
		Dictionary<MusicState, string> musicSpecEvents = new Dictionary<MusicState, string> { 
		{
			(MusicState)3,
			"Custom_Hellscape_Explore"
		} };
		CustomWwiseAPI.RegisterMusicConfig("Hellscape_music", "testenviromusic", musicSpecEvents, new string[2] { "Hellscape", "Swamp" });
		CustomWwiseAPI.RegisterMusicConfig("General_music", "testmusic", musicEvents, (string[])null);
		CustomWwiseAPI.EnableMusicConfig("General_music");
		CustomWwiseAPI.EnableMusicConfig("Hellscape_music");
		((BaseUnityPlugin)this).Logger.LogInfo((object)"Custom music activated!");
	}
}