Decompiled source of PizzaTruck v1.0.1

PizzaHutCruiser.dll

Decompiled 2 months ago
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
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("PizzaHutCruiser")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PizzaHutCruiser")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("877206d4-e77d-422e-a3a7-6a16e19484ad")]
[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 PizzaHutCruiser;

[BepInPlugin("ironbean.PizzaTruck", "PizzaTruck", "1.0.1")]
public class PizzaTruck : BaseUnityPlugin
{
	[HarmonyPatch(typeof(VehicleController))]
	internal class CruiserPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void CreatePatch(VehicleController __instance)
		{
			MeshRenderer[] componentsInChildren = ((Component)__instance).gameObject.GetComponentsInChildren<MeshRenderer>(true);
			foreach (MeshRenderer val in componentsInChildren)
			{
				if (((Object)val).name.StartsWith("MainBody"))
				{
					((Renderer)val).material.mainTexture = (Texture)(object)truckTex;
				}
			}
		}
	}

	private const string modGUID = "ironbean.PizzaTruck";

	private const string modName = "PizzaTruck";

	private const string modVersion = "1.0.1";

	private readonly Harmony harmony = new Harmony("ironbean.PizzaTruck");

	private static PizzaTruck Instance;

	internal static ManualLogSource mls;

	private static Texture2D truckTex;

	private void Awake()
	{
		if ((Object)(object)Instance == (Object)null)
		{
			Instance = this;
		}
		mls = Logger.CreateLogSource("ironbean.PizzaTruck");
		mls.LogInfo((object)"Pizza Pizza");
		AssetBundle val = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "littlecaesars"));
		truckTex = val.LoadAsset<Texture2D>("Assets/Texture2D/lcpcruiser.png");
		harmony.PatchAll(typeof(PizzaTruck));
		harmony.PatchAll(typeof(CruiserPatch));
	}
}