using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BobotUtils;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.SceneManagement;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("DropPodRetexture")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+c41d222e43e01bf595121464463426a582532adb")]
[assembly: AssemblyProduct("DropPodRetexture")]
[assembly: AssemblyTitle("DropPodRetexture")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
internal sealed class NullableAttribute : Attribute
{
public readonly byte[] NullableFlags;
public NullableAttribute(byte P_0)
{
NullableFlags = new byte[1] { P_0 };
}
public NullableAttribute(byte[] P_0)
{
NullableFlags = P_0;
}
}
[CompilerGenerated]
[Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
internal sealed class NullableContextAttribute : Attribute
{
public readonly byte Flag;
public NullableContextAttribute(byte P_0)
{
Flag = P_0;
}
}
}
namespace DropPodsRevamped
{
[HarmonyPatch]
[BepInPlugin("bobot.DropPodsRevamped", "Drop Pods Revamped", "1.0.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class Plugin : BaseUnityPlugin
{
private const string GUID = "bobot.DropPodsRevamped";
private static Harmony _harmony;
private static AssetBundle bundle;
public const string bundleName = "droppodretexture";
private void Start()
{
//IL_0077: Unknown result type (might be due to invalid IL or missing references)
//IL_00d4: 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_016e: 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)
bundle = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "droppodretexture"));
TextureReplacer.textureToReplace.Add(new ReplacementInfo("Assets/Models/Objects/Bomb/Bomb.mat", new(string, Texture2D)[2]
{
("_MainTex", bundle.LoadAsset<Texture2D>("T_Bomb_Base")),
("_EmissiveTex", bundle.LoadAsset<Texture2D>("T_Bomb_Emissive"))
}, (ValueTuple<string, Color>[])null, (ValueTuple<string, float>[])null));
TextureReplacer.textureToReplace.Add(new ReplacementInfo("Assets/Models/Objects/Bomb/BombRedGlow.mat", new(string, Texture2D)[2]
{
("_MainTex", bundle.LoadAsset<Texture2D>("T_Bomb_Base")),
("_EmissiveTex", bundle.LoadAsset<Texture2D>("T_Bomb_Emissive"))
}, (ValueTuple<string, Color>[])null, (ValueTuple<string, float>[])null));
TextureReplacer.textureToReplace.Add(new ReplacementInfo("Assets/Models/Objects/Bomb/BombNoGlow.mat", new(string, Texture2D)[1] { ("_MainTex", bundle.LoadAsset<Texture2D>("T_Bomb_Base")) }, (ValueTuple<string, Color>[])null, (ValueTuple<string, float>[])null));
TextureReplacer.textureToReplace.Add(new ReplacementInfo("Assets/Models/Objects/Bomb/BombRed.mat", new(string, Texture2D)[2]
{
("_MainTex", bundle.LoadAsset<Texture2D>("T_Bomb_Red")),
("_EmissiveTex", bundle.LoadAsset<Texture2D>("T_Bomb_Emissive"))
}, (ValueTuple<string, Color>[])null, (ValueTuple<string, float>[])null));
TextureReplacer.textureToReplace.Add(new ReplacementInfo("Assets/Models/Objects/Bomb/BombRedRedGlow.mat", new(string, Texture2D)[2]
{
("_MainTex", bundle.LoadAsset<Texture2D>("T_Bomb_Red")),
("_EmissiveTex", bundle.LoadAsset<Texture2D>("T_Bomb_Emissive"))
}, (ValueTuple<string, Color>[])null, (ValueTuple<string, float>[])null));
SceneManager.sceneLoaded += delegate
{
//IL_0006: 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_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
Mesh val = Addressables.LoadAssetAsync<Mesh>((object)"Assets/Models/Objects/Bomb/BombPod_4.fbx[StreetCleaner_PodModel]").WaitForCompletion();
Mesh val2 = Addressables.LoadAssetAsync<Mesh>((object)"Assets/Models/Objects/Bomb/BombPod_4.fbx[StreetCleanerPod_Door]").WaitForCompletion();
NormalSolver.RecalculateNormals(val, 60f);
NormalSolver.RecalculateNormals(val2, 60f);
};
}
}
}