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 BepInEx.Logging; 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("bitmotte.twentyfivepercentgreener")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("twentyfivepercentgreener")] [assembly: AssemblyTitle("bitmotte.twentyfivepercentgreener")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [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 twentyfivepercentgreener { public static class BundleTool { public static AssetBundle Load(string fileName) { return AssetBundle.LoadFromMemory(EmbeddedAccess.AccessFile(fileName)); } } public static class EmbeddedAccess { public static byte[] AccessFile(string fileName) { Assembly executingAssembly = Assembly.GetExecutingAssembly(); byte[] array; using (Stream stream = executingAssembly.GetManifestResourceStream("twentyfivepercentgreener.resources." + fileName)) { if (stream == null) { return null; } array = new byte[stream.Length]; stream.Read(array, 0, array.Length); } return array; } } [BepInPlugin("bitmotte.twentyfivepercentgreener", "twentyfivepercentgreener", "1.0.0")] public class Plugin : BaseUnityPlugin { internal static ManualLogSource Logger; private void Awake() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown Logger = ((BaseUnityPlugin)this).Logger; Logger.LogInfo((object)"Plugin bitmotte.twentyfivepercentgreener is loaded!"); Harmony val = new Harmony("bitmotte.twentyfivepercentgreener"); val.PatchAll(); SceneManager.sceneLoaded += OnSceneLoad; } private void OnSceneLoad(Scene scene, LoadSceneMode mode) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown AssetBundle val = BundleTool.Load("MauricePrime.bundle"); GameObject val2 = Object.Instantiate((GameObject)val.LoadAsset("Assets/green.prefab")); val.Unload(false); } } public static class SetupResource { public static GameObject FixShader(GameObject gameObject) { //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_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) Shader shader = Addressables.LoadAssetAsync((object)"Assets/Materials/Environment/Metal/Pattern 1/Metal Pattern 1 8.mat").WaitForCompletion().shader; SkinnedMeshRenderer[] componentsInChildren = gameObject.GetComponentsInChildren(); foreach (SkinnedMeshRenderer val in componentsInChildren) { Material[] materials = ((Renderer)val).materials; foreach (Material val2 in materials) { if (((Object)val2.shader).name == "ULTRAKILL/Master") { val2.shader = shader; } if (((Object)val2.shader).name == "Hidden/InternalErrorShader") { val2.shader = Addressables.LoadAssetAsync((object)"Assets/Materials/Dev/FadeToWhite.mat").WaitForCompletion().shader; } } } MeshRenderer[] componentsInChildren2 = gameObject.GetComponentsInChildren(); foreach (MeshRenderer val3 in componentsInChildren2) { Material[] materials2 = ((Renderer)val3).materials; foreach (Material val4 in materials2) { val4.shader = shader; } } return gameObject; } } public static class MyPluginInfo { public const string PLUGIN_GUID = "bitmotte.twentyfivepercentgreener"; public const string PLUGIN_NAME = "twentyfivepercentgreener"; public const string PLUGIN_VERSION = "1.0.0"; } }