Decompiled source of RWBYEnding v1.1.0

RWBYEnding.dll

Decompiled 6 months ago
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using RWBYEnding.Patches;
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("RWBYEnding")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("RWBYEnding")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("0111248a-9351-4485-9687-71c3896a0f7b")]
[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")]
namespace RWBYEnding
{
	[BepInPlugin("RWBYEnding", "RWBYEnding", "1.0.0.0")]
	public class RWBYEnding : BaseUnityPlugin
	{
		private const string modGUID = "RWBYEnding";

		private const string modName = "RWBYEnding";

		private const string modVersion = "1.0.0.0";

		private readonly Harmony harmony = new Harmony("RWBYEnding");

		private static RWBYEnding Instance;

		internal ManualLogSource mls;

		internal static List<AudioClip> SoundFX;

		internal static AssetBundle Bundle;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("RWBYEnding");
			mls.LogInfo((object)"Roman Torchwick will be unhappy with you if you fail. 'You've loaded correctly!'");
			harmony.PatchAll(typeof(RWBYEnding));
			harmony.PatchAll(typeof(StartOfRoundPatch));
			mls = ((BaseUnityPlugin)this).Logger;
			SoundFX = new List<AudioClip>();
			string location = ((BaseUnityPlugin)Instance).Info.Location;
			location = location.TrimEnd("RWBYEnding.dll".ToCharArray());
			Bundle = AssetBundle.LoadFromFile(location + "romanending");
			if ((Object)(object)Bundle != (Object)null)
			{
				mls.LogInfo((object)"Correctly loaded 'romanending'. Do you think Red is going to save the world?");
				SoundFX = Bundle.LoadAllAssets<AudioClip>().ToList();
			}
			else
			{
				mls.LogError((object)"Failed to load 'romanending'. Do you have it in your main directory?");
			}
		}
	}
}
namespace RWBYEnding.Patches
{
	[HarmonyPatch(typeof(StartOfRound))]
	internal class StartOfRoundPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		private static void OverrideAudio(StartOfRound __instance)
		{
			__instance.firedVoiceSFX = RWBYEnding.SoundFX[0];
		}
	}
}