using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("OGCruiserWahSkin")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("OGCruiserWahSkin")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("bb396747-6b9a-4565-b3fe-727147fe9a96")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace CruiserWahSkin;
[BepInPlugin("OrnateGamer.CruiserWahSkin", "OrnateGamer Cruiser Wah Skin", "1.0.0.0")]
internal class CruiserBase : BaseUnityPlugin
{
private const string modGUID = "OrnateGamer.CruiserWahSkin";
private const string modName = "OrnateGamer Cruiser Wah Skin";
private const string modVersion = "1.0.0.0";
private readonly Harmony harmony = new Harmony("OrnateGamer.CruiserWahSkin");
private static CruiserBase Instance;
internal ManualLogSource mls;
private void Awake()
{
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)Instance == (Object)null)
{
Instance = this;
}
new Harmony("CruiserSkin").PatchAll(typeof(CruiserBase));
mls = Logger.CreateLogSource("OrnateGamer.CruiserWahSkin");
mls.LogInfo((object)"The mod has awoke");
}
[HarmonyPatch(typeof(VehicleController), "Start")]
[HarmonyPostfix]
private static void StartPatch()
{
//IL_0003: Unknown result type (might be due to invalid IL or missing references)
//IL_0009: Expected O, but got Unknown
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_0047: Expected O, but got Unknown
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0069: Expected O, but got Unknown
//IL_0081: Unknown result type (might be due to invalid IL or missing references)
//IL_008b: Expected O, but got Unknown
//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
//IL_00ad: Expected O, but got Unknown
//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
//IL_00cf: Expected O, but got Unknown
//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
//IL_00f1: Expected O, but got Unknown
//IL_0109: Unknown result type (might be due to invalid IL or missing references)
//IL_0113: Expected O, but got Unknown
Texture2D val = new Texture2D(2, 2);
string path = Path.Combine(Paths.PluginPath, "OrnateGamer-OGCruiserWahSkin/CruiserSkin/cruiser.png");
ImageConversion.LoadImage(val, File.ReadAllBytes(path));
((Renderer)GameObject.Find("MainBody").GetComponent<MeshRenderer>()).materials[0].mainTexture = (Texture)val;
((Renderer)GameObject.Find("MainBody (1)").GetComponent<MeshRenderer>()).materials[0].mainTexture = (Texture)val;
((Renderer)GameObject.Find("MainBody (2)").GetComponent<MeshRenderer>()).materials[0].mainTexture = (Texture)val;
((Renderer)GameObject.Find("DoorRightContainer").GetComponentInChildren<MeshRenderer>()).materials[0].mainTexture = (Texture)val;
((Renderer)GameObject.Find("DoorLeftContainer").GetComponentInChildren<MeshRenderer>()).materials[0].mainTexture = (Texture)val;
((Renderer)GameObject.Find("CarHoodMesh").GetComponent<MeshRenderer>()).materials[0].mainTexture = (Texture)val;
((Renderer)GameObject.Find("BackDoorMesh").GetComponent<SkinnedMeshRenderer>()).materials[0].mainTexture = (Texture)val;
}
[HarmonyPatch(typeof(VehicleController), "DestroyCar")]
[HarmonyPostfix]
private static void DestroyCarPatch()
{
//IL_0003: Unknown result type (might be due to invalid IL or missing references)
//IL_0009: Expected O, but got Unknown
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_0047: Expected O, but got Unknown
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0069: Expected O, but got Unknown
//IL_0081: Unknown result type (might be due to invalid IL or missing references)
//IL_008b: Expected O, but got Unknown
Texture2D val = new Texture2D(2, 2);
string path = Path.Combine(Paths.PluginPath, "OrnateGamer-OGCruiserWahSkin/CruiserSkin/cruiser_destroyed.png");
ImageConversion.LoadImage(val, File.ReadAllBytes(path));
((Renderer)GameObject.Find("MainBodyDestroyed").GetComponent<MeshRenderer>()).materials[0].mainTexture = (Texture)val;
((Renderer)GameObject.Find("DoorRightContainer").GetComponentInChildren<MeshRenderer>()).materials[0].mainTexture = (Texture)val;
((Renderer)GameObject.Find("DoorLeftContainer").GetComponentInChildren<MeshRenderer>()).materials[0].mainTexture = (Texture)val;
}
}