Decompiled source of feralStartup v1.0.0

feralStartup.dll

Decompiled 5 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 UnityEngine;
using feralStartup.Patches;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("feralStartup")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("feralStartup")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("6e25df76-c29f-44fe-b96a-55d25cc6bd82")]
[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 feralStartup
{
	[BepInPlugin("feralhalfawake", "feralStartup", "1.0.0")]
	public class feralModBase : BaseUnityPlugin
	{
		private const string modGUID = "feralhalfawake";

		private const string modName = "feralStartup";

		private const string modVersion = "1.0.0";

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

		private static feralModBase 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("feralhalfawake");
			mls.LogInfo((object)"ARARARRARRRARRAAARARARARARR");
			harmony.PatchAll(typeof(feralModBase));
			harmony.PatchAll(typeof(VehicleControllerPatch));
			mls = ((BaseUnityPlugin)this).Logger;
			SoundFX = new List<AudioClip>();
			string location = ((BaseUnityPlugin)Instance).Info.Location;
			location = location.TrimEnd("feralStartup.dll".ToCharArray());
			Bundle = AssetBundle.LoadFromFile(location + "revving");
			if ((Object)(object)Bundle != (Object)null)
			{
				mls.LogInfo((object)"Succeded to load asset bundle");
				SoundFX = Bundle.LoadAllAssets<AudioClip>().ToList();
			}
			else
			{
				mls.LogError((object)"Failed to load assetbundle");
			}
		}
	}
}
namespace feralStartup.Patches
{
	[HarmonyPatch(typeof(VehicleController))]
	internal class VehicleControllerPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		private static void OverrideAudio(VehicleController __instance)
		{
			__instance.engineRev = feralModBase.SoundFX[0];
		}
	}
}