Decompiled source of Bananacar v1.0.0

Bananacar.dll

Decompiled 4 hours ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using Bananacar;
using Chassis.Api;
using DooDesch;
using HarmonyLib;
using Il2CppFishNet;
using Il2CppFishNet.Managing;
using Il2CppFishNet.Managing.Object;
using Il2CppFishNet.Object;
using Il2CppInterop.Runtime.Attributes;
using Il2CppInterop.Runtime.Injection;
using Il2CppInterop.Runtime.InteropTypes;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppScheduleOne.DevUtilities;
using Il2CppScheduleOne.Dialogue;
using Il2CppScheduleOne.NPCs.CharacterClasses;
using Il2CppScheduleOne.Vehicles;
using Il2CppSystem.Collections.Generic;
using Il2CppTMPro;
using MelonLoader;
using Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: MelonInfo(typeof(BananacarMod), "Bananacar", "1.0.0", "DooDesch", "https://github.com/DooDesch-Mods/ScheduleOne-Bananacar")]
[assembly: MelonGame("TVGS", "Schedule I")]
[assembly: MelonAdditionalDependencies(new string[] { "Chassis" })]
[assembly: AssemblyMetadata("SourceNotice", "Bananacar by DooDesch, MIT License. The source code is public at https://github.com/DooDesch-Mods/ScheduleOne-Bananacar. Please read, change and reuse the source code, not decompiled code from this file. Text and data mining reserved under Art. 4(3) Directive (EU) 2019/790 and § 44b(3) UrhG.")]
[assembly: AssemblyMetadata("License", "https://github.com/DooDesch-Mods/ScheduleOne-Bananacar/blob/main/LICENSE.md")]
[assembly: AssemblyMetadata("SourceCode", "https://github.com/DooDesch-Mods/ScheduleOne-Bananacar")]
[assembly: AssemblyMetadata("tdm-reservation", "1")]
[assembly: AssemblyMetadata("tdm-policy", "https://github.com/DooDesch-Mods/ScheduleOne-Bananacar/blob/main/LICENSE.md")]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("DooDesch")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyCopyright("Copyright © DooDesch. MIT License. Source code: https://github.com/DooDesch-Mods/ScheduleOne-Bananacar")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+09e3cd0deb7b236f5f088f3ab9329c4825ea55e4")]
[assembly: AssemblyProduct("Bananacar")]
[assembly: AssemblyTitle("Bananacar")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: AssemblyMetadata("AI_Assisted_Creation", "This assembly was partially created with the assistance of Generative AI.")]
[assembly: AssemblyMetadata("AI_Model_Vendor", "Anthropic/OpenAI")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace DooDesch
{
	[AttributeUsage(AttributeTargets.All, Inherited = false)]
	internal sealed class SourceNoticeAttribute : Attribute
	{
		public string Notice { get; }

		public SourceNoticeAttribute(string notice)
		{
			Notice = notice;
		}
	}
	[SourceNotice("Bananacar by DooDesch, MIT License. Please read and reuse the source code at https://github.com/DooDesch-Mods/ScheduleOne-Bananacar, not decompiled code.")]
	internal static class SourceNotice
	{
		internal const string Text = "Bananacar by DooDesch, MIT License. The source code is public at https://github.com/DooDesch-Mods/ScheduleOne-Bananacar. Please read, change and reuse the source code, not decompiled code from this file. Text and data mining reserved under Art. 4(3) Directive (EU) 2019/790 and § 44b(3) UrhG.";

		internal const string Short = "Bananacar by DooDesch, MIT License. Please read and reuse the source code at https://github.com/DooDesch-Mods/ScheduleOne-Bananacar, not decompiled code.";
	}
	[SourceNotice("Bananacar by DooDesch, MIT License. Please read and reuse the source code at https://github.com/DooDesch-Mods/ScheduleOne-Bananacar, not decompiled code.")]
	internal static class ModVersion
	{
		internal const string Current = "1.0.0";
	}
}
namespace Bananacar
{
	[SourceNotice("Bananacar by DooDesch, MIT License. Please read and reuse the source code at https://github.com/DooDesch-Mods/ScheduleOne-Bananacar, not decompiled code.")]
	internal static class BananaBody
	{
		private const float CushionTop = -0.07f;

		private const float RearSeatLift = 0.14f;

		private const float LeafSeatLift = 0.115f;

		private const string WheelName = "BananaSteering";

		private const int Sides = 30;

		private const int OpeningHalf = 6;

		private const int OpeningStart = 11;

		private const int OpeningEnd = 17;

		private const int CargoRear = 8;

		private const int CargoFront = 10;

		private const int CargoHalf = 3;

		private static readonly (float Z, float Y, float Width, float Height)[] Rings = new(float, float, float, float)[25]
		{
			(-2.88f, 1.56f, 0.074f, 0.054f),
			(-2.87f, 1.51f, 0.083f, 0.06f),
			(-2.84f, 1.41f, 0.078f, 0.062f),
			(-2.8f, 1.3f, 0.093f, 0.072f),
			(-2.75f, 1.19f, 0.118f, 0.094f),
			(-2.68f, 0.99f, 0.178f, 0.15f),
			(-2.57f, 0.74f, 0.27f, 0.24f),
			(-2.4f, 0.47f, 0.4f, 0.33f),
			(-2.2f, 0.28f, 0.53f, 0.42f),
			(-1.92f, 0.12f, 0.66f, 0.48f),
			(-1.61f, 0.02f, 0.75f, 0.5f),
			(-1.34f, -0.01f, 0.83f, 0.5f),
			(-1.01f, -0.03f, 0.89f, 0.48f),
			(-0.65f, -0.06f, 0.92f, 0.46f),
			(-0.2f, -0.09f, 0.93f, 0.44f),
			(0.23f, -0.08f, 0.93f, 0.44f),
			(0.65f, -0.05f, 0.9f, 0.44f),
			(1.13f, -0.02f, 0.83f, 0.43f),
			(1.43f, 0.02f, 0.77f, 0.41f),
			(1.76f, 0.06f, 0.67f, 0.37f),
			(2.05f, 0.1f, 0.54f, 0.3f),
			(2.31f, 0.13f, 0.43f, 0.24f),
			(2.54f, 0.18f, 0.27f, 0.16f),
			(2.68f, 0.2f, 0.11f, 0.085f),
			(2.73f, 0.21f, 0.06f, 0.055f)
		};

		internal static ChassisProfile Fit(LandVehicle car)
		{
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Expected O, but got Unknown
			//IL_032c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0331: Unknown result type (might be due to invalid IL or missing references)
			//IL_033c: Unknown result type (might be due to invalid IL or missing references)
			//IL_033d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0342: Unknown result type (might be due to invalid IL or missing references)
			//IL_034d: Unknown result type (might be due to invalid IL or missing references)
			//IL_035d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0362: Unknown result type (might be due to invalid IL or missing references)
			//IL_036c: Expected O, but got Unknown
			//IL_036c: Unknown result type (might be due to invalid IL or missing references)
			//IL_036d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0377: Expected O, but got Unknown
			//IL_0377: Unknown result type (might be due to invalid IL or missing references)
			//IL_0380: Expected O, but got Unknown
			//IL_03c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0404: Unknown result type (might be due to invalid IL or missing references)
			//IL_0418: Unknown result type (might be due to invalid IL or missing references)
			//IL_0440: Unknown result type (might be due to invalid IL or missing references)
			//IL_0454: Unknown result type (might be due to invalid IL or missing references)
			//IL_047c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0490: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_050a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0535: Unknown result type (might be due to invalid IL or missing references)
			//IL_0549: Unknown result type (might be due to invalid IL or missing references)
			//IL_0574: Unknown result type (might be due to invalid IL or missing references)
			//IL_0588: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_05cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_05fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_060e: Unknown result type (might be due to invalid IL or missing references)
			//IL_063d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0651: Unknown result type (might be due to invalid IL or missing references)
			//IL_0695: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_06db: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0805: Unknown result type (might be due to invalid IL or missing references)
			//IL_080a: Unknown result type (might be due to invalid IL or missing references)
			//IL_075b: Unknown result type (might be due to invalid IL or missing references)
			//IL_076f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0866: Unknown result type (might be due to invalid IL or missing references)
			//IL_0868: Unknown result type (might be due to invalid IL or missing references)
			//IL_0872: Unknown result type (might be due to invalid IL or missing references)
			//IL_0874: Unknown result type (might be due to invalid IL or missing references)
			//IL_087e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0883: Unknown result type (might be due to invalid IL or missing references)
			//IL_0888: Unknown result type (might be due to invalid IL or missing references)
			//IL_088c: Unknown result type (might be due to invalid IL or missing references)
			//IL_089e: Unknown result type (might be due to invalid IL or missing references)
			//IL_08af: Unknown result type (might be due to invalid IL or missing references)
			//IL_08b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_08f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0902: Unknown result type (might be due to invalid IL or missing references)
			//IL_0907: Unknown result type (might be due to invalid IL or missing references)
			//IL_091b: Unknown result type (might be due to invalid IL or missing references)
			//IL_099d: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_09b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_09b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_09d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_09de: Unknown result type (might be due to invalid IL or missing references)
			//IL_0952: Unknown result type (might be due to invalid IL or missing references)
			//IL_0966: Unknown result type (might be due to invalid IL or missing references)
			//IL_096b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0979: Unknown result type (might be due to invalid IL or missing references)
			//IL_0989: Expected O, but got Unknown
			if ((Object)(object)car.vehicleModel == (Object)null || car.Seats == null || ((Il2CppArrayBase<VehicleSeat>)(object)car.Seats).Length == 0)
			{
				throw new InvalidOperationException("The Hounddog model or its seats are missing.");
			}
			Transform transform = ((Component)car).transform;
			Transform transform2 = car.vehicleModel.transform;
			Shader paintShader = Shader.Find("Universal Render Pipeline/Lit");
			if ((Object)(object)paintShader == (Object)null)
			{
				throw new InvalidOperationException("The URP Lit shader is unavailable for the peel.");
			}
			Il2CppArrayBase<Wheel> componentsInChildren = ((Component)car).GetComponentsInChildren<Wheel>(true);
			foreach (MeshRenderer componentsInChild in ((Component)car).GetComponentsInChildren<MeshRenderer>(true))
			{
				bool flag = false;
				foreach (Wheel item in componentsInChildren)
				{
					if (!((Object)(object)item.wheelModel == (Object)null) && ((Component)componentsInChild).transform.IsChildOf(item.wheelModel))
					{
						flag = true;
						break;
					}
				}
				if (!flag)
				{
					((Renderer)componentsInChild).enabled = false;
				}
			}
			GameObject val = new GameObject("BananaBody")
			{
				layer = ((Component)transform2).gameObject.layer
			};
			val.transform.SetParent(transform, false);
			val.transform.SetParent(transform2, true);
			Material val2 = Paint("Ripe peel", "FFD236");
			Material val3 = Paint("Peel ribs", "F2AD25");
			Material val4 = Paint("Peel freckles", "CA912F");
			Material val5 = Paint("Green neck", "9CBA3D");
			Material val6 = Paint("Stalk", "58743D");
			Material val7 = Paint("Dried tip", "473621");
			Material val8 = Paint("Inside the peel", "D6AB5A");
			Material val9 = Paint("Scrapyard black", "242625");
			Material leaf = Paint("Banana leaf", "669733", 0.38f);
			Material shoot = Paint("Folded leaf", "456D35", 0.35f);
			Material val10 = Paint("Banana leaf blade", "FFFFFF", 0.32f);
			Material val11 = Paint("Banana leaf underside", "C0D4AA", 0.24f);
			Texture2D val12 = MakeLeafTexture();
			val10.SetTexture("_BaseMap", (Texture)(object)val12);
			val11.SetTexture("_BaseMap", (Texture)(object)val12);
			Material[] palette = (Material[])(object)new Material[2] { val10, val11 };
			Material val13 = Paint("Bolt heads", "91968C", 0.48f);
			Material material = Paint("Headlamp lens", "FFF0B7", 0.5f);
			Material material2 = Paint("Tail lamp lens", "AB3326", 0.5f);
			Material material3 = Paint("Indicator lens", "BC6A20", 0.53f);
			Material material4 = Paint("Reverse lamp lens", "D6DABE", 0.45f);
			Material material5 = Paint("Plate enamel", "FFF2B3", 0.55f);
			Transform transform3 = val.transform;
			ChassisProfile val14 = new ChassisProfile
			{
				Code = "doodesch_bananacar",
				Horn = new HornProfile
				{
					Clip = "bananacar_squeak",
					Position = new Vector3(0f, 0.06f, 2f)
				},
				Lamps = new LampProfile(),
				AutoLights = true
			};
			BuildPeel(transform3, val14, (Material[])(object)new Material[7] { val2, val3, val4, val5, val6, val7, val8 });
			Block(transform3, "Footwell", new Vector3(0f, -0.25f, -0.09f), new Vector3(1.3f, 0.09f, 1.98f), val9);
			Block(transform3, "Front bumper", new Vector3(0f, -0.1f, 2.4f), new Vector3(0.89f, 0.15f, 0.18f), val9);
			Block(transform3, "Rear bumper", new Vector3(0f, -0.2f, -2.37f), new Vector3(1.25f, 0.15f, 0.18f), val9);
			Block(transform3, "Plate", new Vector3(0f, -0.18f, -2.47f), new Vector3(0.56f, 0.16f, 0.035f), material5);
			BuildPlate(transform3, val9);
			MeshRenderer[] array = (MeshRenderer[])(object)new MeshRenderer[2];
			MeshRenderer[] array2 = (MeshRenderer[])(object)new MeshRenderer[2];
			MeshRenderer[] array3 = (MeshRenderer[])(object)new MeshRenderer[2];
			for (int i = 0; i < 2; i++)
			{
				float num = ((i == 0) ? (-1f) : 1f);
				Block(transform3, "Leaf green side step", new Vector3(num * 0.935f, -0.25f, -0.09f), new Vector3(0.115f, 0.075f, 1.31f), val6);
				Block(transform3, "Rear bumper bracket", new Vector3(num * 0.43f, -0.15f, -2.165f), new Vector3(0.14f, 0.15f, 0.47f), val9);
				Block(transform3, "Headlamp shell", new Vector3(num * 0.36f, 0.03f, 2.27f), new Vector3(0.31f, 0.21f, 0.2f), val9);
				array[i] = Block(transform3, "Headlamp", new Vector3(num * 0.36f, 0.03f, 2.38f), new Vector3(0.24f, 0.14f, 0.035f), material);
				array2[i] = Block(transform3, "Tail lamp", new Vector3(num * 0.49f, -0.1f, -2.36f), new Vector3(0.22f, 0.13f, 0.04f), material2);
				array3[i] = Block(transform3, "Reverse lamp", new Vector3(num * 0.341f, -0.1f, -2.44f), new Vector3(0.056f, 0.068f, 0.033f), material4);
				string text = ((i == 0) ? "BananaIndicatorLeft" : "BananaIndicatorRight");
				Block(transform3, text + "Front", new Vector3(num * 0.55f, 0.036f, 2.285f), new Vector3(0.124f, 0.088f, 0.042f), material3);
				Block(transform3, text + "Rear", new Vector3(num * 0.49f, 0.014f, -2.371f), new Vector3(0.216f, 0.076f, 0.04f), material3);
				List<string> obj = ((i == 0) ? val14.Lamps.Left : val14.Lamps.Right);
				obj.Add(text + "Front");
				obj.Add(text + "Rear");
				Block(transform3, "Bumper bolt", new Vector3(num * 0.37f, -0.1f, 2.5f), new Vector3(0.06f, 0.06f, 0.025f), val13);
			}
			FitLights(car, array, array2, array3);
			Il2CppReferenceArray<VehicleSeat> seats = car.Seats;
			Vector3 val16 = default(Vector3);
			for (int j = 0; j < ((Il2CppArrayBase<VehicleSeat>)(object)seats).Length; j++)
			{
				VehicleSeat val15 = ((Il2CppArrayBase<VehicleSeat>)(object)seats)[j];
				if ((Object)(object)val15 == (Object)null || j >= 4)
				{
					throw new InvalidOperationException($"Unexpected Hounddog seat at index {j}.");
				}
				float num2 = Mathf.Sign(transform.InverseTransformPoint(((Component)val15).transform.position).x) * 0.38f;
				bool flag2 = j >= 2;
				float num3 = (flag2 ? (-0.85f) : 0.27f);
				((Vector3)(ref val16))..ctor(num2, -0.07f + (flag2 ? 0.14f : 0f), num3);
				((Component)val15).transform.position = transform.TransformPoint(val16);
				Vector3 val17 = val16 + Vector3.up * 0.115f;
				BuildSeatSupport(transform3, val17, val6, shoot);
				BuildLeaf(transform3, "Leaf cushion", val17 + new Vector3(0f, -0.027f, -0.18f), Quaternion.Euler(-90f, 180f, 0f), 0.48f, 0.45f, Mathf.Sign(num2), 0.006f, palette);
				BuildLeaf(transform3, "Leaf backrest", val17 + new Vector3(0f, -0.035f, -0.183f), Quaternion.Euler(-11f, 0f, 0f), 0.51f, 0.55f, Mathf.Sign(num2), 0.035f, palette);
				Transform val18 = null;
				if (j == 0)
				{
					val18 = BuildWheel(transform3, new Vector3(num2, 0.41f, 0.8f), val9, val13, leaf);
					val14.Steering = new SteeringProfile
					{
						Path = RelativePath(transform, val18),
						Ratio = 3.8f
					};
				}
				SeatProfile val19 = ChassisApi.FitSeat(car, j, transform, val18, 0.035f);
				val19.Eyes = val16 + new Vector3(0f, 0.88f, 0.09f);
				val19.Feet.Position = new Vector3(num2 + 0.13f, -0.21f, num3 + 0.48f);
				val14.Seats.Add(val19);
			}
			BananaCockpit.Fit(val14, transform3, val9, val6, val2);
			return val14;
			Material Paint(string name, string hex, float gloss = 0.2f)
			{
				//IL_0030: Unknown result type (might be due to invalid IL or missing references)
				//IL_0035: Unknown result type (might be due to invalid IL or missing references)
				//IL_003c: Unknown result type (might be due to invalid IL or missing references)
				//IL_003d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0043: Unknown result type (might be due to invalid IL or missing references)
				//IL_0050: Expected O, but got Unknown
				Color color = default(Color);
				if (!ColorUtility.TryParseHtmlString("#" + hex, ref color))
				{
					throw new ArgumentException("Bad material colour for " + name + ".");
				}
				Material val20 = new Material(paintShader)
				{
					name = name,
					color = color
				};
				val20.SetFloat("_Smoothness", gloss);
				return val20;
			}
		}

		private static void FitLights(LandVehicle car, MeshRenderer[] head, MeshRenderer[] tail, MeshRenderer[] reverse)
		{
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_014a: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			VehicleLights component = ((Component)car).GetComponent<VehicleLights>();
			if ((Object)(object)component == (Object)null)
			{
				throw new InvalidOperationException("The Hounddog has no VehicleLights component.");
			}
			component.headLightMeshes = Il2CppReferenceArray<MeshRenderer>.op_Implicit(head);
			component.brakeLightMeshes = Il2CppReferenceArray<MeshRenderer>.op_Implicit(tail);
			component.hasReverseLights = true;
			component.reverseLightMeshes = Il2CppReferenceArray<MeshRenderer>.op_Implicit(reverse);
			component.headLightMat_Off = ((Renderer)head[0]).sharedMaterial;
			component.brakeLightMat_Off = ((Renderer)tail[0]).sharedMaterial;
			component.headlightMat_On = Glow(((Renderer)head[0]).sharedMaterial, new Color(2.4f, 2.1f, 1.5f));
			component.brakeLightMat_On = Glow(((Renderer)tail[0]).sharedMaterial, new Color(2.6f, 0.12f, 0.025f));
			component.reverseLightMat_Off = ((Renderer)reverse[0]).sharedMaterial;
			component.reverseLightMat_On = Glow(((Renderer)reverse[0]).sharedMaterial, new Color(2.2f, 2.2f, 1.85f));
			if (component.headLightSources == null)
			{
				return;
			}
			foreach (OptimizedLight item in (Il2CppArrayBase<OptimizedLight>)(object)component.headLightSources)
			{
				if (!((Object)(object)item == (Object)null))
				{
					Vector3 val = ((Component)car).transform.InverseTransformPoint(((Component)item).transform.position);
					((Component)item).transform.position = ((Component)car).transform.TransformPoint(new Vector3(Mathf.Sign(val.x) * 0.36f, 0.03f, 2.42f));
				}
			}
		}

		private static Material Glow(Material lens, Color emission)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Expected O, but got Unknown
			Material val = new Material(lens);
			val.EnableKeyword("_EMISSION");
			val.SetColor("_EmissionColor", emission);
			return val;
		}

		private static void BuildPeel(Transform parent, ChassisProfile profile, Material[] materials)
		{
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_0326: Unknown result type (might be due to invalid IL or missing references)
			//IL_032b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0353: Unknown result type (might be due to invalid IL or missing references)
			//IL_0362: Unknown result type (might be due to invalid IL or missing references)
			//IL_0370: Unknown result type (might be due to invalid IL or missing references)
			//IL_0377: Unknown result type (might be due to invalid IL or missing references)
			List<Vector3> list = new List<Vector3>();
			List<int>[] array = new List<int>[materials.Length];
			for (int i = 0; i < array.Length; i++)
			{
				array[i] = new List<int>();
			}
			Vector3 val = default(Vector3);
			Vector3 val2 = default(Vector3);
			for (int j = 0; j < Rings.Length; j++)
			{
				(float Z, float Y, float Width, float Height) tuple = Rings[j];
				float item = tuple.Z;
				float item2 = tuple.Y;
				float item3 = tuple.Width;
				float item4 = tuple.Height;
				(float, float, float, float) tuple2 = Rings[Mathf.Max(0, j - 1)];
				(float, float, float, float) tuple3 = Rings[Mathf.Min(Rings.Length - 1, j + 1)];
				float num = Mathf.InverseLerp(-1.92f, -2.24f, item);
				float num2 = Mathf.Atan2(tuple2.Item2 - tuple3.Item2, tuple3.Item1 - tuple2.Item1) * num;
				((Vector3)(ref val))..ctor(0f, Mathf.Cos(num2), Mathf.Sin(num2));
				((Vector3)(ref val2))..ctor(0f, item2, item);
				for (int k = 0; k < 30; k++)
				{
					float num3 = (float)k * (float)Math.PI * 2f / 30f;
					float num4 = 1f + 0.038f * Mathf.Cos(num3 * 5f);
					list.Add(val2 + Vector3.right * (item3 * Mathf.Sin(num3) * num4) + val * (item4 * Mathf.Cos(num3) * num4));
				}
			}
			for (int l = 0; l < Rings.Length - 1; l++)
			{
				for (int m = 0; m < 30; m++)
				{
					bool flag = m < 6 || m >= 24;
					if (l >= 11 && l < 17 && flag)
					{
						continue;
					}
					bool flag2 = m < 3 || m >= 27;
					if (!(l >= 8 && l < 10 && flag2))
					{
						int num5 = (m + 1) % 30;
						int num6 = 0;
						if (m % 6 == 2)
						{
							num6 = 1;
						}
						if (((l - 4) * 17 + m * 11) % 79 == 3 && l > 6 && l < Rings.Length - 3)
						{
							num6 = 2;
						}
						if (l < 7 || (l == 7 && m % 6 < 2))
						{
							num6 = ((l < 4) ? 4 : 3);
						}
						if (l == 0 || l == Rings.Length - 2)
						{
							num6 = 5;
						}
						Quad(array[num6], l * 30 + m, (l + 1) * 30 + m, (l + 1) * 30 + num5, l * 30 + num5);
					}
				}
			}
			int num7 = Rings.Length - 1;
			for (int n = 1; n < 29; n++)
			{
				array[5].AddRange(new int[3]
				{
					0,
					n,
					n + 1
				});
				array[5].AddRange(new int[3]
				{
					num7 * 30,
					num7 * 30 + n + 1,
					num7 * 30 + n
				});
			}
			int count = list.Count;
			for (int num8 = 11; num8 <= 17; num8++)
			{
				int index = num8 * 30 + 6;
				Vector3 val3 = list[index];
				for (int num9 = 0; num9 < 13; num9++)
				{
					float num10 = (float)(num9 - 6) / 6f;
					float num11 = Mathf.Pow(Mathf.Abs(num10), 5f);
					list.Add(new Vector3(val3.x * num10, Mathf.Lerp(-0.27f, val3.y, num11), val3.z));
				}
			}
			for (int num12 = 0; num12 < 6; num12++)
			{
				for (int num13 = 0; num13 < 12; num13++)
				{
					int num14 = count + num12 * 13 + num13;
					Quad(array[6], num14, num14 + 13, num14 + 13 + 1, num14 + 1);
				}
			}
			for (int num15 = 0; num15 < 12; num15++)
			{
				int num16 = (30 + num15 - 6) % 30;
				int num17 = (num16 + 1) % 30;
				int num18 = count + 78 + num15;
				Quad(array[6], 330 + num17, 330 + num16, count + num15, count + num15 + 1);
				Quad(array[6], 510 + num16, 510 + num17, num18 + 1, num18);
			}
			MeshPart(parent, "Peel", list, array, materials);
			BuildCargo(parent, profile, list, materials);
		}

		private static void BuildCargo(Transform parent, ChassisProfile profile, List<Vector3> shell, Material[] materials)
		{
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Expected O, but got Unknown
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Expected O, but got Unknown
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0196: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: Unknown result type (might be due to invalid IL or missing references)
			List<Vector3> list = new List<Vector3>(21);
			for (int i = 8; i <= 10; i++)
			{
				for (int j = -3; j <= 3; j++)
				{
					list.Add(shell[i * 30 + (j + 30) % 30]);
				}
			}
			Vector3 val = list[17];
			GameObject val2 = new GameObject("BananaCargoHinge")
			{
				layer = ((Component)parent).gameObject.layer
			};
			val2.transform.SetParent(parent, false);
			val2.transform.localPosition = val;
			profile.Parts.Add(new PartProfile
			{
				Name = "cargo",
				Path = ((Object)val2).name,
				Storage = "rear",
				Axis = Vector3.right,
				Sign = 1f,
				Angle = 64f,
				Seconds = 0.65f
			});
			Vector3 val3 = list[10];
			List<Vector3> list2 = new List<Vector3>(42);
			List<Vector3> list3 = new List<Vector3>(42);
			foreach (Vector3 item in list)
			{
				list2.Add(Vector3.Lerp(item, val3, 0.027f) - val + Vector3.up * 0.004f);
				list3.Add(new Vector3(item.x * 0.91f, 0.075f, item.z));
			}
			for (int k = 0; k < 21; k++)
			{
				list2.Add(list2[k] - Vector3.up * 0.025f);
			}
			list3.AddRange(list);
			List<int>[] lidFaces = new List<int>[3]
			{
				new List<int>(),
				new List<int>(),
				new List<int>()
			};
			List<int> trayFaces = new List<int>();
			for (int l = 0; l < 2; l++)
			{
				for (int m = 0; m < 6; m++)
				{
					int num = l * 7 + m;
					int num2 = (m - 3 + 30) % 30;
					Quad(lidFaces[(num2 % 6 == 2) ? 1u : 0u], num, num + 7, num + 7 + 1, num + 1);
					Quad(lidFaces[2], num + 21 + 1, num + 21 + 7 + 1, num + 21 + 7, num + 21);
					Quad(trayFaces, num, num + 7, num + 7 + 1, num + 1);
				}
			}
			for (int n = 0; n < 6; n++)
			{
				Edge(n, n + 1);
				Edge(14 + n + 1, 14 + n);
			}
			for (int num3 = 0; num3 < 2; num3++)
			{
				Edge((num3 + 1) * 7, num3 * 7);
				Edge(num3 * 7 + 7 - 1, (num3 + 1) * 7 + 7 - 1);
			}
			MeshPart(val2.transform, "CargoPeel", list2, lidFaces, (Material[])(object)new Material[3]
			{
				materials[0],
				materials[1],
				materials[6]
			});
			MeshPart(parent, "Cargo tray", list3, new List<int>[1] { trayFaces }, (Material[])(object)new Material[1] { materials[6] });
			void Edge(int a, int b)
			{
				Quad(lidFaces[2], a, b, b + 21, a + 21);
				Quad(trayFaces, a, b, b + 21, a + 21);
			}
		}

		private static void BuildSeatSupport(Transform parent, Vector3 seat, Material stem, Material shoot)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			float num = seat.y - 0.006f - -0.209f;
			Vector3 val = default(Vector3);
			((Vector3)(ref val))..ctor(seat.x, -0.209f, seat.z - 0.09f);
			Stalk("Leaf seat stalk", stem, val, new Vector3(0f, num * 0.54f, -0.006f), new Vector3(0f, num, -0.036f), new Vector2(0.094f, 0.075f), new Vector2(0.053f, 0.065f));
			Stalk("Leaf seat shoot", shoot, val + new Vector3(0f, num * 0.27f, 0.014f), new Vector3(0f, num * 0.43f, 0.075f), new Vector3(0f, num * 0.73f - 0.024f, 0.192f), new Vector2(0.044f, 0.052f), new Vector2(0.027f, 0.025f), -0.15f);
			void Stalk(string name, Material material, Vector3 start, Vector3 middle, Vector3 end, Vector2 startRadius, Vector2 endRadius, float tipSlope = 0f)
			{
				//IL_001c: Unknown result type (might be due to invalid IL or missing references)
				//IL_001d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0022: Unknown result type (might be due to invalid IL or missing references)
				//IL_0024: Unknown result type (might be due to invalid IL or missing references)
				//IL_0029: Unknown result type (might be due to invalid IL or missing references)
				//IL_002a: Unknown result type (might be due to invalid IL or missing references)
				//IL_002d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0033: Unknown result type (might be due to invalid IL or missing references)
				//IL_0038: Unknown result type (might be due to invalid IL or missing references)
				//IL_003d: Unknown result type (might be due to invalid IL or missing references)
				//IL_003f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0041: Unknown result type (might be due to invalid IL or missing references)
				//IL_0049: Unknown result type (might be due to invalid IL or missing references)
				//IL_004e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0066: Unknown result type (might be due to invalid IL or missing references)
				//IL_0078: Unknown result type (might be due to invalid IL or missing references)
				//IL_007a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0092: Unknown result type (might be due to invalid IL or missing references)
				//IL_0097: Unknown result type (might be due to invalid IL or missing references)
				List<Vector3> list = new List<Vector3>();
				List<int> list2 = new List<int>();
				for (int i = 0; i <= 5; i++)
				{
					float num2 = (float)i / 5f;
					Vector3 val2 = start + Vector3.Lerp(Vector3.Lerp(Vector3.zero, middle, num2), Vector3.Lerp(middle, end, num2), num2);
					Vector2 val3 = Vector2.Lerp(startRadius, endRadius, Mathf.Sqrt(num2));
					for (int j = 0; j < 8; j++)
					{
						float num3 = (float)Math.PI * 2f * (float)j / 8f;
						float num4 = val3.y * Mathf.Sin(num3);
						list.Add(val2 + new Vector3(val3.x * Mathf.Cos(num3), num2 * num4 * tipSlope, num4));
						if (i != 0)
						{
							int num5 = (j + 1) % 8;
							Quad(list2, (i - 1) * 8 + j, i * 8 + j, i * 8 + num5, (i - 1) * 8 + num5);
						}
					}
				}
				for (int k = 1; k < 7; k++)
				{
					list2.AddRange(new int[3]
					{
						40,
						40 + k + 1,
						40 + k
					});
				}
				MeshPart(parent, name, list, new List<int>[1] { list2 }, (Material[])(object)new Material[1] { material });
			}
		}

		private static Texture2D MakeLeafTexture()
		{
			//IL_0218: Unknown result type (might be due to invalid IL or missing references)
			//IL_021d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0228: Unknown result type (might be due to invalid IL or missing references)
			//IL_022f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0236: Unknown result type (might be due to invalid IL or missing references)
			//IL_0242: Unknown result type (might be due to invalid IL or missing references)
			//IL_024b: Expected O, but got Unknown
			//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
			Color32[] array = (Color32[])(object)new Color32[65536];
			for (int i = 0; i < 256; i++)
			{
				float num = (float)i / 255f;
				for (int j = 0; j < 256; j++)
				{
					float num2 = 2f * (float)j / 255f - 1f;
					float num3 = MathF.Abs(num2);
					float num4 = 0.22f * num3 - 0.068f * num3 * num3;
					float num5 = (num - num4) * 11.6f + 0.06f * MathF.Sin(3.3f * num2 + 20f * num);
					float num6 = Falloff(MathF.Abs(num5 - MathF.Round(num5)), 0.014f, 0.115f) * (0.44f + 0.56f * (1f - num3));
					num6 *= 1f - 0.42f * (1f - Falloff(num3, 0.86f, 1f)) * Falloff(num, 0.08f, 0.18f);
					float num7 = Falloff(num3, 0.009f, 0.055f - 0.028f * num) * (1f - 0.54f * num);
					float num8 = (1f - Falloff(num3, 0.79f, 1f)) * 0.055f;
					float num9 = 0.043f * MathF.Sin((float)Math.PI * num) + 0.022f * num2 + 0.015f * MathF.Sin(5f * num + 2.8f * num2);
					array[i * 256 + j] = new Color32(Channel(0.32f + num9 + 0.135f * num6 + 0.28f * num7 - num8), Channel(0.55f + num9 + 0.1f * num6 + 0.135f * num7 - num8), Channel(0.235f + num9 + 0.035f * num6 + 0.065f * num7 - num8 * 0.5f), byte.MaxValue);
				}
			}
			Texture2D val = new Texture2D(256, 256, (TextureFormat)4, true)
			{
				name = "Banana leaf veins",
				wrapMode = (TextureWrapMode)1,
				filterMode = (FilterMode)2
			};
			val.SetPixels32(Il2CppStructArray<Color32>.op_Implicit(array));
			val.Apply(true, true);
			return val;
			static byte Channel(float value)
			{
				return (byte)(Math.Clamp(value, 0f, 1f) * 255f);
			}
			static float Falloff(float value, float start, float end)
			{
				float num10 = Math.Clamp((value - start) / (end - start), 0f, 1f);
				return 1f - num10 * num10 * (3f - 2f * num10);
			}
		}

		private static void BuildLeaf(Transform parent, string name, Vector3 position, Quaternion rotation, float width, float length, float lean, float ribDepth, Material[] palette)
		{
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_0145: Unknown result type (might be due to invalid IL or missing references)
			//IL_014a: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
			List<Vector3> list = new List<Vector3>(374);
			List<Vector3> list2 = new List<Vector3>(187);
			Vector2[] array = (Vector2[])(object)new Vector2[374];
			Vector3 val = default(Vector3);
			for (int i = 0; i < 17; i++)
			{
				float num = (float)i / 16f;
				float num2 = Mathf.Sin((float)Math.PI * Mathf.Pow(num, 0.87f));
				float num3 = Mathf.Lerp(0.47f, 0.016f, num) + 0.75f * Mathf.Max(0f, num2) * (1f - 0.15f * num);
				for (int j = 0; j < 11; j++)
				{
					float num4 = (float)j / 10f;
					float num5 = 2f * num4 - 1f;
					float num6 = num5 * num5;
					float num7 = Mathf.Sin(num * 21f + num5 * 2f) * 0.008f * num6 * num6;
					float num8 = Mathf.Exp(-49f * num6) * (1f - num) * (1f - num);
					((Vector3)(ref val))..ctor(width * (num3 * num5 * 0.5f + lean * 0.12f * num * num), num * length, 0.028f * (1f - num6) - 0.055f * num * num + num7 + 0.003f * num8);
					list.Add(position + rotation * val);
					float num9 = Mathf.Lerp(0.009f, 0.004f, num6) * (1f - 0.65f * num) + ribDepth * num8;
					list2.Add(position + rotation * (val - Vector3.forward * num9));
					array[i * 11 + j] = (array[187 + i * 11 + j] = new Vector2(num4, num));
				}
			}
			list.AddRange(list2);
			List<int> list3 = new List<int>();
			List<int> back = new List<int>();
			for (int k = 0; k < 16; k++)
			{
				int num10 = k * 11;
				for (int l = 0; l < 10; l++)
				{
					int num11 = num10 + l;
					Quad(list3, num11, num11 + 1, num11 + 11 + 1, num11 + 11);
					int num12 = num11 + 187;
					Quad(back, num12, num12 + 11, num12 + 11 + 1, num12 + 1);
				}
				Seal(num10, num10 + 11);
				Seal(num10 + 22 - 1, num10 + 11 - 1);
			}
			for (int m = 0; m < 10; m++)
			{
				Seal(m + 1, m);
				Seal(176 + m, 176 + m + 1);
			}
			MeshPart(parent, name, list, new List<int>[2] { list3, back }, palette, array);
			void Seal(int from, int to)
			{
				Quad(back, from, to, to + 187, from + 187);
			}
		}

		private static Transform BuildWheel(Transform parent, Vector3 position, Material rubber, Material metal, Material leaf)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Unknown result type (might be due to invalid IL or missing references)
			//IL_019c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("BananaSteering")
			{
				layer = ((Component)parent).gameObject.layer
			};
			val.transform.SetParent(parent, false);
			val.transform.localPosition = position;
			val.transform.localRotation = Quaternion.Euler(12f, 0f, 0f);
			List<Vector3> list = new List<Vector3>();
			List<int> list2 = new List<int>();
			for (int i = 0; i < 20; i++)
			{
				float num = (float)i * (float)Math.PI * 2f / 20f;
				for (int j = 0; j < 6; j++)
				{
					float num2 = (float)j * (float)Math.PI * 2f / 6f;
					float num3 = 0.166f + 0.024f * Mathf.Cos(num2);
					list.Add(new Vector3(num3 * Mathf.Cos(num), num3 * Mathf.Sin(num), 0.024f * Mathf.Sin(num2)));
					int num4 = (i + 1) % 20;
					int num5 = (j + 1) % 6;
					Quad(list2, i * 6 + j, num4 * 6 + j, num4 * 6 + num5, i * 6 + num5);
				}
			}
			MeshPart(val.transform, "Rubber rim", list, new List<int>[1] { list2 }, (Material[])(object)new Material[1] { rubber });
			Block(val.transform, "Spoke", Vector3.zero, new Vector3(0.31f, 0.035f, 0.034f), metal);
			Block(val.transform, "Hub", Vector3.zero, new Vector3(0.1f, 0.087f, 0.064f), rubber);
			Block(val.transform, "BananaHornButton", new Vector3(0f, 0f, -0.039f), new Vector3(0.077f, 0.057f, 0.025f), leaf);
			return val.transform;
		}

		private static void BuildPlate(Transform parent, Material ink)
		{
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			string[] array = new string[7] { "1111110000111101000011111", "1111110000111110000111111", "1111100100001000010000100", "0111010001100011000101110", "1000111001101011001110001", "1111100100001000010011111", "0111010001111111000110001" };
			List<Vector3> list = new List<Vector3>();
			List<int> list2 = new List<int>();
			for (int i = 0; i < array.Length; i++)
			{
				for (int j = 0; j < array[i].Length; j++)
				{
					if (array[i][j] != '0')
					{
						float num = -0.2255f + (float)(i * 6 + j % 5) * 0.011f;
						float num2 = -0.1525f - (float)(j / 5) * 0.011f;
						int count = list.Count;
						list.Add(new Vector3(num, num2, -2.49f));
						list.Add(new Vector3(num + 0.011f, num2, -2.49f));
						list.Add(new Vector3(num + 0.011f, num2 - 0.011f, -2.49f));
						list.Add(new Vector3(num, num2 - 0.011f, -2.49f));
						Quad(list2, count, count + 1, count + 2, count + 3);
					}
				}
			}
			MeshPart(parent, "Estonia lettering", list, new List<int>[1] { list2 }, (Material[])(object)new Material[1] { ink });
		}

		private static string RelativePath(Transform root, Transform child)
		{
			string text = ((Object)child).name;
			Transform parent = child.parent;
			while ((Object)(object)parent != (Object)(object)root)
			{
				text = ((Object)parent).name + "/" + text;
				parent = parent.parent;
			}
			return text;
		}

		private static MeshRenderer Block(Transform parent, string name, Vector3 center, Vector3 size, Material material, float tilt = 0f)
		{
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			GameObject obj = GameObject.CreatePrimitive((PrimitiveType)3);
			Object.DestroyImmediate((Object)(object)obj.GetComponent<Collider>());
			((Object)obj).name = name;
			obj.layer = ((Component)parent).gameObject.layer;
			obj.transform.SetParent(parent, false);
			obj.transform.localPosition = center;
			obj.transform.localScale = size;
			obj.transform.localRotation = Quaternion.Euler(tilt, 0f, 0f);
			MeshRenderer component = obj.GetComponent<MeshRenderer>();
			((Renderer)component).sharedMaterial = material;
			return component;
		}

		internal static void MeshPart(Transform parent, string name, List<Vector3> vertices, List<int>[] faces, Material[] materials, Vector2[] uv = null)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Expected O, but got Unknown
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Expected O, but got Unknown
			GameObject val = new GameObject(name)
			{
				layer = ((Component)parent).gameObject.layer
			};
			val.transform.SetParent(parent, false);
			Mesh val2 = new Mesh
			{
				name = name,
				vertices = Il2CppStructArray<Vector3>.op_Implicit(vertices.ToArray()),
				subMeshCount = faces.Length
			};
			if (uv != null)
			{
				val2.uv = Il2CppStructArray<Vector2>.op_Implicit(uv);
			}
			for (int i = 0; i < faces.Length; i++)
			{
				val2.SetTriangles(Il2CppStructArray<int>.op_Implicit(faces[i].ToArray()), i);
			}
			val2.RecalculateNormals();
			val2.RecalculateBounds();
			val.AddComponent<MeshFilter>().sharedMesh = val2;
			((Renderer)val.AddComponent<MeshRenderer>()).sharedMaterials = Il2CppReferenceArray<Material>.op_Implicit(materials);
		}

		private static void Quad(List<int> triangles, int a, int b, int c, int d)
		{
			triangles.Add(a);
			triangles.Add(b);
			triangles.Add(c);
			triangles.Add(a);
			triangles.Add(c);
			triangles.Add(d);
		}
	}
	[SourceNotice("Bananacar by DooDesch, MIT License. Please read and reuse the source code at https://github.com/DooDesch-Mods/ScheduleOne-Bananacar, not decompiled code.")]
	public sealed class BananacarMod : MelonMod
	{
		[HarmonyPatch(typeof(VehicleManager), "Awake")]
		private static class VehicleRegistration
		{
			private static void Postfix(VehicleManager __instance)
			{
				try
				{
					LandVehicle vehiclePrefab = __instance.GetVehiclePrefab("doodesch_bananacar");
					if ((Object)(object)vehiclePrefab != (Object)null)
					{
						if ((Object)(object)vehiclePrefab != (Object)(object)prefab)
						{
							Log.Error("Vehicle code doodesch_bananacar is in use. Bananacar registration skipped.");
						}
						return;
					}
					NetworkManager networkManager = InstanceFinder.NetworkManager;
					PrefabObjects val = ((networkManager != null) ? networkManager.SpawnablePrefabs : null);
					if ((Object)(object)val == (Object)null)
					{
						throw new InvalidOperationException("FishNet spawnable prefabs are unavailable.");
					}
					if ((Object)(object)prefab == (Object)null)
					{
						prefab = BuildPrefab(__instance);
					}
					NetworkObject component = ((Component)prefab).GetComponent<NetworkObject>();
					int objectCount = val.GetObjectCount();
					bool flag = false;
					for (int i = 0; i < objectCount; i++)
					{
						if (!((Object)(object)val.GetObject(true, i) != (Object)(object)component))
						{
							flag = true;
							break;
						}
					}
					if (!flag)
					{
						val.AddObject(component, false);
					}
					__instance.VehiclePrefabs.Add(prefab);
					Log.Msg($"Registered {"doodesch_bananacar"} with FishNet prefab ID {component.PrefabId}.");
				}
				catch (Exception value)
				{
					Log.Error($"Registration failed for {"doodesch_bananacar"}. Bananacar is unavailable. {value}");
				}
			}
		}

		[HarmonyPatch(typeof(ControlledDialogueHandler), "ModifyChoiceList")]
		private static class Dealership
		{
			private static void Postfix(ControlledDialogueHandler __instance, ref List<DialogueChoiceData> existingChoices)
			{
				//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
				//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
				//IL_01e7: Expected O, but got Unknown
				//IL_017d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0182: Unknown result type (might be due to invalid IL or missing references)
				//IL_0192: Expected O, but got Unknown
				try
				{
					DialogueHandler_VehicleSalesman val = ((Il2CppObjectBase)__instance).TryCast<DialogueHandler_VehicleSalesman>();
					if ((Object)(object)val == (Object)null || existingChoices == null || (Object)(object)prefab == (Object)null)
					{
						return;
					}
					VehicleManager instance = NetworkSingleton<VehicleManager>.Instance;
					LandVehicle val2 = ((instance != null) ? instance.GetVehiclePrefab("doodesch_bananacar") : null);
					if ((Object)(object)val2 == (Object)null || ((Il2CppObjectBase)val2).Pointer != ((Il2CppObjectBase)prefab).Pointer)
					{
						return;
					}
					int num = -1;
					for (int i = 0; i < existingChoices.Count; i++)
					{
						DialogueChoiceData val3 = existingChoices[i];
						if (val3 != null)
						{
							if (string.Equals(val3.ChoiceLabel, "doodesch_bananacar", StringComparison.OrdinalIgnoreCase))
							{
								return;
							}
							if (string.Equals(val3.ChoiceLabel, "cheetah", StringComparison.OrdinalIgnoreCase))
							{
								num = i;
							}
						}
					}
					if (num < 0)
					{
						return;
					}
					DialogueChoiceData val4 = existingChoices[num];
					Conversation activeDialogue = DialogueHandler.ActiveDialogue;
					NodeLinkData val5 = ((activeDialogue != null) ? activeDialogue.GetLink(val4.Guid) : null);
					if (val5 == null || (Object)(object)val.Salesman == (Object)null || val.Salesman.Listings == null)
					{
						if (!reportedMissingLink)
						{
							Log.Error("Jeremy's listing data or Cheetah dialogue link is missing. doodesch_bananacar is unavailable at the dealership.");
						}
						reportedMissingLink = true;
						return;
					}
					reportedMissingLink = false;
					List<DealershipListing> listings = val.Salesman.Listings;
					bool flag = false;
					for (int j = 0; j < listings.Count; j++)
					{
						DealershipListing obj = listings[j];
						if (string.Equals((obj != null) ? obj.vehicleCode : null, "doodesch_bananacar", StringComparison.OrdinalIgnoreCase))
						{
							flag = true;
							break;
						}
					}
					if (!flag)
					{
						listings.Add(new DealershipListing
						{
							vehicleCode = "doodesch_bananacar"
						});
					}
					((DialogueHandler)val).CreateTempLink(val5.BaseDialogueOrBranchNodeGuid, "doodesch_bananacar_dealer", val5.TargetNodeGuid);
					existingChoices.Insert(num + 1, new DialogueChoiceData
					{
						Guid = "doodesch_bananacar_dealer",
						ChoiceLabel = "doodesch_bananacar",
						ChoiceText = "The Bananacar (<PRICE>)",
						ShowWorldspaceDialogue = val4.ShowWorldspaceDialogue
					});
					if (!reportedListing)
					{
						Log.Msg("Jeremy offers doodesch_bananacar for $4,999.");
					}
					reportedListing = true;
				}
				catch (Exception value)
				{
					Log.Error($"Could not offer {"doodesch_bananacar"} in Jeremy's dialogue. {value}");
				}
			}
		}

		internal const string Code = "doodesch_bananacar";

		internal const string Horn = "bananacar_squeak";

		private const string DonorCode = "hounddog";

		private const string ChoiceId = "doodesch_bananacar_dealer";

		private static LandVehicle prefab;

		private static bool reportedMissingLink;

		private static bool reportedListing;

		internal static Instance Log { get; private set; }

		internal static bool Listed => reportedListing;

		public override void OnInitializeMelon()
		{
			Log = ((MelonBase)this).LoggerInstance;
			Log.Msg("Bananacar idea by Estonia.");
			BananaVfx.Install(((MelonBase)this).HarmonyInstance);
		}

		private static LandVehicle BuildPrefab(VehicleManager manager)
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Expected O, but got Unknown
			LandVehicle vehiclePrefab = manager.GetVehiclePrefab("hounddog");
			if ((Object)(object)vehiclePrefab == (Object)null)
			{
				throw new InvalidOperationException("Missing donor prefab hounddog.");
			}
			GameObject val = new GameObject("BananacarStaging");
			val.SetActive(false);
			GameObject val2 = null;
			try
			{
				val2 = Object.Instantiate<GameObject>(((Component)vehiclePrefab).gameObject, val.transform, false);
				val2.SetActive(false);
				val2.transform.SetParent((Transform)null, false);
				((Object)val2).name = "Bananacar";
				LandVehicle component = val2.GetComponent<LandVehicle>();
				if ((Object)(object)val2.GetComponent<NetworkObject>() == (Object)null)
				{
					throw new InvalidOperationException("The donor clone has no FishNet NetworkObject.");
				}
				component.vehicleCode = "doodesch_bananacar";
				component.vehicleName = "Bananacar";
				component.vehiclePrice = 4999f;
				component.TopSpeed = Mathf.Min(component.TopSpeed, 18f);
				BananaHandling.Fit(component);
				ChassisProfile obj = BananaBody.Fit(component);
				BananaVfx.Attach(val2);
				ChassisApi.RegisterSound("bananacar_squeak", MakeHorn());
				ChassisApi.SetPaintTargets("doodesch_bananacar", (Func<LandVehicle, IEnumerable<PaintTarget>>)PaintPeel);
				ChassisApi.Register(obj);
				Object.DontDestroyOnLoad((Object)(object)val2);
				return component;
			}
			catch
			{
				if ((Object)(object)val2 != (Object)null)
				{
					Object.Destroy((Object)(object)val2);
				}
				throw;
			}
			finally
			{
				Object.Destroy((Object)(object)val);
			}
		}

		private static IEnumerable<PaintTarget> PaintPeel(LandVehicle car)
		{
			foreach (MeshRenderer renderer in ((Component)car).GetComponentsInChildren<MeshRenderer>(true))
			{
				string name = ((Object)renderer).name;
				if (name == "Peel" || name == "CargoPeel")
				{
					yield return new PaintTarget((Renderer)(object)renderer, 0);
					yield return new PaintTarget((Renderer)(object)renderer, 1, true);
				}
			}
		}

		private static AudioClip MakeHorn()
		{
			float[] array = new float[8820];
			for (int i = 0; i < 2; i++)
			{
				float num = 0f;
				for (int j = 0; j < 3675; j++)
				{
					float num2 = (float)j / 3674f;
					float num3 = ((i == 0) ? 420f : 630f) + 360f * num2 - 420f * num2 * num2;
					num += (float)Math.PI * 2f * num3 / 22050f;
					float num4 = Mathf.Min(num2 * 18f, 1f) * (1f - num2);
					array[i * 5145 + j] = 0.53f * num4 * (Mathf.Sin(num) + 0.28f * Mathf.Sin(num * 3f) + 0.13f * Mathf.Sin(num * 5f));
				}
			}
			AudioClip val = AudioClip.Create("bananacar_squeak", array.Length, 1, 22050, false);
			if ((Object)(object)val == (Object)null || !val.SetData(Il2CppStructArray<float>.op_Implicit(array), 0))
			{
				throw new InvalidOperationException("Could not initialise the Bananacar horn clip.");
			}
			return val;
		}
	}
	[SourceNotice("Bananacar by DooDesch, MIT License. Please read and reuse the source code at https://github.com/DooDesch-Mods/ScheduleOne-Bananacar, not decompiled code.")]
	internal static class BananaCockpit
	{
		private static readonly Color Green = new Color(0.17f, 0.29f, 0.1f);

		private static readonly Color Ink = new Color(0.06f, 0.11f, 0.04f);

		private static readonly Color Cream = new Color(0.98f, 0.88f, 0.51f);

		private static readonly Color Lime = new Color(0.56f, 0.75f, 0.24f);

		private static readonly Color Red = new Color(0.85f, 0.19f, 0.065f);

		private const float ButtonFaceZ = 0.78f;

		private const float GaugeFaceZ = 0.8935f;

		internal static void Fit(ChassisProfile profile, Transform body, Material dial, Material bezel, Material peel)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Expected O, but got Unknown
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Expected O, but got Unknown
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01db: Unknown result type (might be due to invalid IL or missing references)
			//IL_020a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0239: Unknown result type (might be due to invalid IL or missing references)
			//IL_0268: Unknown result type (might be due to invalid IL or missing references)
			//IL_0292: Unknown result type (might be due to invalid IL or missing references)
			//IL_0297: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0310: Unknown result type (might be due to invalid IL or missing references)
			//IL_0324: Unknown result type (might be due to invalid IL or missing references)
			//IL_0344: Unknown result type (might be due to invalid IL or missing references)
			//IL_036e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0398: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0416: Unknown result type (might be due to invalid IL or missing references)
			//IL_044c: Unknown result type (might be due to invalid IL or missing references)
			//IL_045c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0461: Unknown result type (might be due to invalid IL or missing references)
			//IL_0468: Unknown result type (might be due to invalid IL or missing references)
			//IL_046e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0486: Unknown result type (might be due to invalid IL or missing references)
			//IL_0496: Unknown result type (might be due to invalid IL or missing references)
			//IL_049b: Unknown result type (might be due to invalid IL or missing references)
			//IL_04af: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0504: Unknown result type (might be due to invalid IL or missing references)
			//IL_050f: Unknown result type (might be due to invalid IL or missing references)
			//IL_051a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0525: Unknown result type (might be due to invalid IL or missing references)
			//IL_0530: Unknown result type (might be due to invalid IL or missing references)
			//IL_0531: Unknown result type (might be due to invalid IL or missing references)
			//IL_0536: Unknown result type (might be due to invalid IL or missing references)
			//IL_053b: Unknown result type (might be due to invalid IL or missing references)
			//IL_054b: Expected O, but got Unknown
			//IL_055f: Unknown result type (might be due to invalid IL or missing references)
			//IL_058b: Unknown result type (might be due to invalid IL or missing references)
			//IL_059b: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_05bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_05fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0609: Unknown result type (might be due to invalid IL or missing references)
			//IL_0614: Unknown result type (might be due to invalid IL or missing references)
			//IL_0615: Unknown result type (might be due to invalid IL or missing references)
			//IL_061a: Unknown result type (might be due to invalid IL or missing references)
			//IL_061f: Unknown result type (might be due to invalid IL or missing references)
			//IL_062f: Expected O, but got Unknown
			//IL_0634: Unknown result type (might be due to invalid IL or missing references)
			//IL_0644: Unknown result type (might be due to invalid IL or missing references)
			//IL_0669: Unknown result type (might be due to invalid IL or missing references)
			//IL_067d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0682: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_06b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_06bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_06db: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0714: Unknown result type (might be due to invalid IL or missing references)
			//IL_0728: Unknown result type (might be due to invalid IL or missing references)
			//IL_072d: Unknown result type (might be due to invalid IL or missing references)
			//IL_074d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0761: Unknown result type (might be due to invalid IL or missing references)
			//IL_0766: Unknown result type (might be due to invalid IL or missing references)
			//IL_0786: Unknown result type (might be due to invalid IL or missing references)
			//IL_079a: Unknown result type (might be due to invalid IL or missing references)
			//IL_079f: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_07d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_07dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_0803: Unknown result type (might be due to invalid IL or missing references)
			//IL_0808: Unknown result type (might be due to invalid IL or missing references)
			//IL_0813: Unknown result type (might be due to invalid IL or missing references)
			//IL_081e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0829: Unknown result type (might be due to invalid IL or missing references)
			//IL_0834: Unknown result type (might be due to invalid IL or missing references)
			//IL_0835: Unknown result type (might be due to invalid IL or missing references)
			//IL_083a: Unknown result type (might be due to invalid IL or missing references)
			//IL_083f: Unknown result type (might be due to invalid IL or missing references)
			//IL_084f: Expected O, but got Unknown
			//IL_085a: Unknown result type (might be due to invalid IL or missing references)
			//IL_085f: Unknown result type (might be due to invalid IL or missing references)
			//IL_086a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0875: Unknown result type (might be due to invalid IL or missing references)
			//IL_0880: Unknown result type (might be due to invalid IL or missing references)
			//IL_088b: Unknown result type (might be due to invalid IL or missing references)
			//IL_088c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0891: Unknown result type (might be due to invalid IL or missing references)
			//IL_0896: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a6: Expected O, but got Unknown
			//IL_08b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_08be: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_0901: Unknown result type (might be due to invalid IL or missing references)
			//IL_0906: Unknown result type (might be due to invalid IL or missing references)
			//IL_0926: Unknown result type (might be due to invalid IL or missing references)
			//IL_093a: Unknown result type (might be due to invalid IL or missing references)
			//IL_093f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0955: Unknown result type (might be due to invalid IL or missing references)
			//IL_0965: Unknown result type (might be due to invalid IL or missing references)
			//IL_096a: Unknown result type (might be due to invalid IL or missing references)
			//IL_096f: Unknown result type (might be due to invalid IL or missing references)
			//IL_097f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0986: Unknown result type (might be due to invalid IL or missing references)
			//IL_09fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a0e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a13: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a42: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a56: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a5b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a73: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a84: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a98: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a9f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aa4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aa6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aa8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aaa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0abe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ac3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ac8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0acd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ae0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0af1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0af6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0afb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b1a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b2b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b30: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b35: Unknown result type (might be due to invalid IL or missing references)
			profile.Interior = new InteriorProfile
			{
				Lining = false,
				Glass = null
			};
			GameObject legend = new GameObject("BananaDashMarkings")
			{
				layer = ((Component)body).gameObject.layer
			};
			legend.transform.SetParent(body, false);
			TMP_FontAsset font = TMP_Settings.defaultFontAsset;
			if ((Object)(object)font == (Object)null)
			{
				foreach (TMP_FontAsset item in Resources.FindObjectsOfTypeAll<TMP_FontAsset>())
				{
					if (!((Object)(object)item == (Object)null))
					{
						font = item;
						break;
					}
				}
			}
			if ((Object)(object)font == (Object)null)
			{
				BananacarMod.Log.Warning("No cockpit font is loaded. The controls retain their Chassis hover labels.");
			}
			Panel("BananaDashLeft", new Vector3(-0.432f, 0.153f, 0.955f), new Vector3(0.51f, 0.186f, 0.3f), Green);
			Panel("BananaCentreStack", new Vector3(0.043f, 0.195f, 0.948f), new Vector3(0.44f, 0.22f, 0.31f), Green);
			Panel("BananaSwitchFascia", new Vector3(0.016f, 0.185f, 0.789f), new Vector3(0.358f, 0.198f, 0.016f), Ink);
			Panel("BananaGaugeStand", new Vector3(0.043f, 0.331f, 0.974f), new Vector3(0.27f, 0.065f, 0.085f), Green);
			BuildInstruments(body, dial, bezel, peel);
			Digits("speed", "SPEED", new Vector3(-0.084f, 0.47f, 0.8935f), "0", 0.037f);
			Digits("rpm", "RPM", new Vector3(0.152f, 0.47f, 0.8935f), "0", 0.033f);
			Digits("odometer", "ODO", new Vector3(-0.079f, 0.398f, 0.8935f), "0.0", 0.024f);
			Digits("trip", "TRIP", new Vector3(0.145f, 0.398f, 0.8935f), "0.0", 0.024f);
			Lamp("indicator_left", new Vector3(-0.157f, 0.502f, 0.893f), Lime);
			Lamp("indicator_right", new Vector3(0.222f, 0.502f, 0.893f), Lime);
			Lamp("lights", new Vector3(0.04f, 0.407f, 0.893f), new Color(0.25f, 0.65f, 1f));
			Lamp("auto_ignition", new Vector3(-0.114f, 0.129f, 0.786f), new Color(1f, 0.61f, 0.12f));
			Switch("indicator_left", "Left indicator", "LEFT", -0.141f, Lime);
			Switch("indicator_right", "Right indicator", "RIGHT", -0.073f, Lime);
			Switch("hazard", "Hazard lights", "HAZ", -0.005f, Red, "hazard");
			Switch("lights", "Headlights", "LIGHT", 0.063f, Cream, "lights");
			Switch("trip_reset", "Reset trip meter", "TRIP", 0.131f, Lime);
			Switch("auto_ignition", "Auto ignition", "AUTO", -0.06f, Cream, "auto_ignition", 0.129f);
			Vector3 val = default(Vector3);
			((Vector3)(ref val))..ctor(-0.25f, 0.139f, 0.795f);
			Piece("BananaKeySocket", "button", val, new Vector3(0.025f, 0f, 0.012f), Ink);
			Piece("Chassis_IgnitionKey", "key", val + new Vector3(0f, 0f, -0.015f), new Vector3(0.009f, 0.03f, 0.048f), new Color(0.65f, 0.7f, 0.57f));
			profile.Controls.Add(new ControlProfile
			{
				Name = "ignition",
				Label = "Ignition",
				Action = "ignition",
				Source = "ignition",
				Path = "Chassis_IgnitionKey",
				Kind = "toggle",
				Axis = Vector3.back,
				Angle = 45f
			});
			Mark("KEY", new Vector3(-0.25f, 0.185f, 0.804f));
			Vector3 val2 = default(Vector3);
			((Vector3)(ref val2))..ctor(0.05f, 0.142f, 0.762f);
			Panel("Chassis_DomeLight", val2, new Vector3(0.06f, 0.028f, 0.024f), Cream);
			profile.Controls.Add(new ControlProfile
			{
				Name = "dome",
				Label = "Cabin light",
				Path = "Chassis_DomeLight",
				Kind = "knob",
				Min = 0f,
				Max = 2f,
				Step = 1f,
				Angle = 0f,
				Axis = Vector3.forward,
				Press = 0.006f
			});
			Mark("CABIN", new Vector3(val2.x, 0.181f, 0.78f));
			Panel("BananaGloveboxBack", new Vector3(0.454f, 0.16f, 1.02f), new Vector3(0.39f, 0.2f, 0.046f), Ink);
			Panel("BananaGloveboxShelf", new Vector3(0.454f, 0.085f, 0.917f), new Vector3(0.39f, 0.035f, 0.24f), Green);
			Panel("BananaGloveboxShade", new Vector3(0.454f, 0.243f, 0.917f), new Vector3(0.39f, 0.034f, 0.24f), Green);
			Panel("BananaGloveboxSideL", new Vector3(0.282f, 0.16f, 0.917f), new Vector3(0.045f, 0.18f, 0.24f), Green);
			Panel("BananaGloveboxSideR", new Vector3(0.626f, 0.16f, 0.917f), new Vector3(0.045f, 0.18f, 0.24f), Green);
			Panel("Chassis_GloveboxLid", new Vector3(0.454f, 0.168f, 0.793f), new Vector3(0.306f, 0.128f, 0.031f), Green);
			Piece("BananaGloveboxHandle", "panel", new Vector3(0.454f, 0.196f, 0.77f), new Vector3(0.11f, 0.015f, 0.023f), Cream, default(Vector3), "Chassis_GloveboxLid");
			profile.Controls.Add(new ControlProfile
			{
				Name = "glovebox",
				Label = "Glovebox",
				Path = "Chassis_GloveboxLid",
				Action = "glovebox",
				Axis = Vector3.forward,
				Press = 0.005f
			});
			profile.Controls.Add(new ControlProfile
			{
				Name = "horn",
				Label = "Banana horn",
				Path = "BananaHornButton",
				Action = "horn",
				Axis = Vector3.forward,
				Press = 0.008f
			});
			Vector3 eye = profile.Seats[0].Eyes;
			Vector3 val3 = default(Vector3);
			((Vector3)(ref val3))..ctor(0.02f, 0.733f, 1.075f);
			Panel("BananaCentreMirrorStem", new Vector3(0.02f, 0.606f, 1.102f), new Vector3(0.029f, 0.202f, 0.03f), Green);
			Panel("BananaCentreMirrorBase", new Vector3(0.02f, 0.504f, 1.05f), new Vector3(0.068f, 0.044f, 0.14f), Green);
			Piece("Chassis_RearMirror", "mirror", val3, new Vector3(0.298f, 0.091f, 0.03f), Ink, MirrorRotation(val3, new Vector3(0f, -0.018f, -1f)));
			Vector3 val4 = default(Vector3);
			for (int i = 0; i < 2; i++)
			{
				float num = ((i == 0) ? (-1f) : 1f);
				string text = ((i == 0) ? "L" : "R");
				((Vector3)(ref val4))..ctor(num * 0.744f, 0.53f, 1.36f);
				Panel("BananaMirrorBase" + text, new Vector3(num * 0.675f, 0.211f, 1.4f), new Vector3(0.094f, 0.083f, 0.095f), Green);
				Piece("BananaMirrorStand" + text, "panel", new Vector3(num * 0.709f, 0.35f, 1.402f), new Vector3(0.038f, 0.276f, 0.041f), Green, new Vector3(0f, 0f, (0f - num) * 13f));
				Vector3 val5 = MirrorRotation(val4, new Vector3(num * 0.268f, -0.035f, -1f));
				Vector3 at = val4 + Quaternion.Euler(val5) * new Vector3(0f, 0f, 0.012f);
				Piece("BananaMirrorHousing" + text, "panel", at, new Vector3(0.229f, 0.13f, 0.042f), Ink, val5);
				Piece("Chassis_SideMirror" + text, "mirror", val4, new Vector3(0.211f, 0.112f, 0.036f), Ink, val5);
			}
			void Digits(string name, string caption, Vector3 val6, string format, float size)
			{
				//IL_000d: Unknown result type (might be due to invalid IL or missing references)
				//IL_001d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0022: Unknown result type (might be due to invalid IL or missing references)
				//IL_003a: Unknown result type (might be due to invalid IL or missing references)
				//IL_003f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0046: Unknown result type (might be due to invalid IL or missing references)
				//IL_0051: Unknown result type (might be due to invalid IL or missing references)
				//IL_0058: Unknown result type (might be due to invalid IL or missing references)
				//IL_005f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0066: Unknown result type (might be due to invalid IL or missing references)
				//IL_006e: Unknown result type (might be due to invalid IL or missing references)
				//IL_006f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0074: Unknown result type (might be due to invalid IL or missing references)
				//IL_007e: Expected O, but got Unknown
				//IL_007f: Unknown result type (might be due to invalid IL or missing references)
				//IL_008f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0094: Unknown result type (might be due to invalid IL or missing references)
				string text2 = "BananaGauge_" + name;
				Panel(text2, val6, new Vector3(0.001f, 0.001f, 0.001f), Ink);
				profile.Gauges.Add(new GaugeProfile
				{
					Name = name,
					Kind = "digits",
					Path = text2,
					Source = name,
					Format = format,
					Size = size,
					Color = Cream
				});
				Mark(caption, val6 + new Vector3(0f, 0.025f, 0f), 0.015f);
			}
			void Lamp(string name, Vector3 at2, Color glow)
			{
				//IL_0012: Unknown result type (might be due to invalid IL or missing references)
				//IL_0022: Unknown result type (might be due to invalid IL or missing references)
				//IL_0027: Unknown result type (might be due to invalid IL or missing references)
				//IL_002e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0034: Unknown result type (might be due to invalid IL or missing references)
				//IL_004b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0050: Unknown result type (might be due to invalid IL or missing references)
				//IL_0057: Unknown result type (might be due to invalid IL or missing references)
				//IL_0062: Unknown result type (might be due to invalid IL or missing references)
				//IL_0069: Unknown result type (might be due to invalid IL or missing references)
				//IL_0070: Unknown result type (might be due to invalid IL or missing references)
				//IL_0071: Unknown result type (might be due to invalid IL or missing references)
				//IL_0072: Unknown result type (might be due to invalid IL or missing references)
				//IL_007c: Expected O, but got Unknown
				string text2 = "BananaLamp_" + name;
				Piece(text2, "lamp", at2, new Vector3(0.017f, 0.012f, 0.007f), Green);
				profile.Gauges.Add(new GaugeProfile
				{
					Name = name,
					Kind = "lamp",
					Path = text2,
					Source = name,
					Color = glow
				});
			}
			void Mark(string words, Vector3 at2, float height = 0.016f)
			{
				//IL_0020: Unknown result type (might be due to invalid IL or missing references)
				if ((Object)(object)font != (Object)null)
				{
					AddLegend(legend.transform, font, words, at2, height);
				}
			}
			Vector3 MirrorRotation(Vector3 housing, Vector3 rearward)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_000c: Unknown result type (might be due to invalid IL or missing references)
				//IL_000f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0016: Unknown result type (might be due to invalid IL or missing references)
				//IL_001b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0020: Unknown result type (might be due to invalid IL or missing references)
				//IL_0023: Unknown result type (might be due to invalid IL or missing references)
				//IL_0028: Unknown result type (might be due to invalid IL or missing references)
				//IL_002d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0032: Unknown result type (might be due to invalid IL or missing references)
				//IL_0037: Unknown result type (might be due to invalid IL or missing references)
				//IL_003a: Unknown result type (might be due to invalid IL or missing references)
				Vector3 val6 = eye - housing;
				val6 = ((Vector3)(ref val6)).normalized + ((Vector3)(ref rearward)).normalized;
				Quaternion val7 = Quaternion.LookRotation(-((Vector3)(ref val6)).normalized, Vector3.up);
				return ((Quaternion)(ref val7)).eulerAngles;
			}
			void Panel(string name, Vector3 at2, Vector3 size, Color color)
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Unknown result type (might be due to invalid IL or missing references)
				Piece(name, "panel", at2, size, color);
			}
			void Piece(string name, string kind, Vector3 position, Vector3 size, Color color, Vector3 rotation = default(Vector3), string parent = "")
			{
				//IL_0011: Unknown result type (might be due to invalid IL or missing references)
				//IL_0016: Unknown result type (might be due to invalid IL or missing references)
				//IL_001d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0024: Unknown result type (might be due to invalid IL or missing references)
				//IL_0025: Unknown result type (might be due to invalid IL or missing references)
				//IL_0026: Unknown result type (might be due to invalid IL or missing references)
				//IL_002b: Unknown result type (might be due to invalid IL or missing references)
				//IL_002c: Unknown result type (might be due to invalid IL or missing references)
				//IL_002d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0032: Unknown result type (might be due to invalid IL or missing references)
				//IL_0033: Unknown result type (might be due to invalid IL or missing references)
				//IL_0035: Unknown result type (might be due to invalid IL or missing references)
				//IL_003a: Unknown result type (might be due to invalid IL or missing references)
				//IL_003b: Unknown result type (might be due to invalid IL or missing references)
				//IL_003d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0042: Unknown result type (might be due to invalid IL or missing references)
				//IL_004f: Expected O, but got Unknown
				profile.Interior.Parts.Add(new KitPart
				{
					Name = name,
					Kind = kind,
					Position = position,
					Size = size,
					Color = color,
					Rotation = rotation,
					Parent = parent
				});
			}
			void Switch(string action, string label, string marking, float x, Color color, string source = "", float y = 0.234f)
			{
				//IL_001c: Unknown result type (might be due to invalid IL or missing references)
				//IL_002c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0031: Unknown result type (might be due to invalid IL or missing references)
				//IL_0046: Unknown result type (might be due to invalid IL or missing references)
				//IL_004b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0052: Unknown result type (might be due to invalid IL or missing references)
				//IL_0059: Unknown result type (might be due to invalid IL or missing references)
				//IL_0060: Unknown result type (might be due to invalid IL or missing references)
				//IL_0067: Unknown result type (might be due to invalid IL or missing references)
				//IL_006f: Unknown result type (might be due to invalid IL or missing references)
				//IL_008a: Unknown result type (might be due to invalid IL or missing references)
				//IL_008b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0090: Unknown result type (might be due to invalid IL or missing references)
				//IL_0095: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
				//IL_00cf: Expected O, but got Unknown
				//IL_00de: Unknown result type (might be due to invalid IL or missing references)
				Vector3 at2 = default(Vector3);
				((Vector3)(ref at2))..ctor(x, y, 0.771f);
				string text2 = "BananaSwitch_" + action;
				Panel(text2, at2, new Vector3(0.044f, 0.034f, 0.018f), color);
				profile.Controls.Add(new ControlProfile
				{
					Name = action,
					Label = label,
					Path = text2,
					Action = action,
					Source = source,
					Kind = ((source.Length == 0) ? "button" : "toggle"),
					Axis = Vector3.forward,
					Angle = 0f,
					Press = 0.007f,
					Default = ((action == "auto_ignition") ? 1f : 0f)
				});
				Mark(marking, new Vector3(x, y + 0.042f, 0.78f), 0.017f);
			}
		}

		private static void BuildInstruments(Transform body, Material dial, Material bezel, Material peel)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Unknown result type (might be due to invalid IL or missing references)
			//IL_018a: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_0194: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0304: Unknown result type (might be due to invalid IL or missing references)
			//IL_0315: Unknown result type (might be due to invalid IL or missing references)
			//IL_031a: Unknown result type (might be due to invalid IL or missing references)
			//IL_032b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0330: Unknown result type (might be due to invalid IL or missing references)
			//IL_0341: Unknown result type (might be due to invalid IL or missing references)
			//IL_0346: Unknown result type (might be due to invalid IL or missing references)
			//IL_0357: Unknown result type (might be due to invalid IL or missing references)
			//IL_035c: Unknown result type (might be due to invalid IL or missing references)
			//IL_036d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0372: Unknown result type (might be due to invalid IL or missing references)
			//IL_0383: Unknown result type (might be due to invalid IL or missing references)
			//IL_0388: Unknown result type (might be due to invalid IL or missing references)
			//IL_0399: Unknown result type (might be due to invalid IL or missing references)
			//IL_039e: Unknown result type (might be due to invalid IL or missing references)
			//IL_03af: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_03dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_040b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0410: Unknown result type (might be due to invalid IL or missing references)
			//IL_0422: Unknown result type (might be due to invalid IL or missing references)
			//IL_0427: Unknown result type (might be due to invalid IL or missing references)
			//IL_0449: Unknown result type (might be due to invalid IL or missing references)
			//IL_044e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0457: Unknown result type (might be due to invalid IL or missing references)
			//IL_0464: Unknown result type (might be due to invalid IL or missing references)
			//IL_0471: Unknown result type (might be due to invalid IL or missing references)
			Vector2[] array = (Vector2[])(object)new Vector2[8]
			{
				new Vector2(-0.193f, -0.088f),
				new Vector2(-0.231f, -0.042f),
				new Vector2(-0.227f, 0.042f),
				new Vector2(-0.182f, 0.081f),
				new Vector2(0.171f, 0.081f),
				new Vector2(0.225f, 0.045f),
				new Vector2(0.231f, -0.033f),
				new Vector2(0.199f, -0.088f)
			};
			List<Vector3> list = new List<Vector3>();
			List<int> list2 = new List<int>();
			List<int> list3 = new List<int>();
			List<int> list4 = new List<int>();
			Vector3 val = default(Vector3);
			((Vector3)(ref val))..ctor(0.037f, 0.439f, 0.89449996f);
			Vector2[] array2 = array;
			foreach (Vector2 val2 in array2)
			{
				list.Add(val + new Vector3(val2.x * 0.96f, val2.y * 0.89f, 0f));
			}
			array2 = array;
			foreach (Vector2 val3 in array2)
			{
				list.Add(val + new Vector3(val3.x, val3.y, 0.014f));
			}
			array2 = array;
			foreach (Vector2 val4 in array2)
			{
				list.Add(val + new Vector3(val4.x * 0.8f, val4.y * 0.78f, 0.13f));
			}
			int num = array.Length;
			for (int j = 0; j < num; j++)
			{
				if (j > 0 && j < num - 1)
				{
					list2.AddRange(new int[3]
					{
						0,
						j,
						j + 1
					});
					list4.AddRange(new int[3]
					{
						num * 2,
						num * 2 + j + 1,
						num * 2 + j
					});
				}
				int num2 = (j + 1) % num;
				list3.AddRange(new int[6]
				{
					j,
					j + num,
					num2 + num,
					j,
					num2 + num,
					num2
				});
				list4.AddRange(new int[6]
				{
					j + num,
					j + num * 2,
					num2 + num * 2,
					j + num,
					num2 + num * 2,
					num2 + num
				});
			}
			BananaBody.MeshPart(body, "Banana instrument cluster", list, new List<int>[3] { list2, list3, list4 }, (Material[])(object)new Material[3] { dial, bezel, dial });
			Vector2[] array3 = (Vector2[])(object)new Vector2[14]
			{
				new Vector2(-0.036f, 0.012f),
				new Vector2(-0.034f, 0.017f),
				new Vector2(-0.023f, 0.002f),
				new Vector2(-0.019f, 0.011f),
				new Vector2(-0.005f, -0.006f),
				new Vector2(0.003f, 0.008f),
				new Vector2(0.017f, -0.006f),
				new Vector2(0.016f, 0.014f),
				new Vector2(0.033f, 0.005f),
				new Vector2(0.024f, 0.027f),
				new Vector2(0.036f, 0.023f),
				new Vector2(0.028f, 0.036f),
				new Vector2(0.032f, 0.042f),
				new Vector2(0.026f, 0.042f)
			};
			List<Vector3> list5 = new List<Vector3>();
			List<int> list6 = new List<int>();
			array2 = array3;
			foreach (Vector2 val5 in array2)
			{
				list5.Add(new Vector3(0.04f + val5.x, 0.453f + val5.y, 0.8935f));
			}
			for (int k = 0; k < array3.Length - 2; k += 2)
			{
				list6.AddRange(new int[6]
				{
					k,
					k + 1,
					k + 3,
					k,
					k + 3,
					k + 2
				});
			}
			BananaBody.MeshPart(body, "Banana instrument emblem", list5, new List<int>[1] { list6 }, (Material[])(object)new Material[1] { peel });
		}

		private static void AddLegend(Transform parent, TMP_FontAsset font, string words, Vector3 at, float height)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject(words)
			{
				layer = ((Component)parent).gameObject.layer
			};
			val.transform.SetParent(parent, false);
			val.transform.localPosition = at;
			TextMeshPro val2 = val.AddComponent<TextMeshPro>();
			((TMP_Text)val2).font = font;
			((TMP_Text)val2).fontSize = 8f;
			((TMP_Text)val2).alignment = (TextAlignmentOptions)514;
			((Graphic)val2).color = Cream;
			((TMP_Text)val2).text = words;
			val.transform.localScale = Vector3.one * (height / Mathf.Max(0.001f, ((TMP_Text)val2).preferredHeight));
		}
	}
	[SourceNotice("Bananacar by DooDesch, MIT License. Please read and reuse the source code at https://github.com/DooDesch-Mods/ScheduleOne-Bananacar, not decompiled code.")]
	internal static class BananaHandling
	{
		private const float WheelbaseScale = 0.84f;

		private const float SteeringLimit = 44f;

		internal static void Fit(LandVehicle car)
		{
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_0179: Unknown result type (might be due to invalid IL or missing references)
			//IL_017b: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_0191: Unknown result type (might be due to invalid IL or missing references)
			//IL_0196: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: Unknown result type