Decompiled source of Everylight v1.0.1

bitmotte.EveryLight.dll

Decompiled 18 hours ago
using System;
using System.Collections.Generic;
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 PluginConfig.API;
using PluginConfig.API.Decorators;
using PluginConfig.API.Fields;
using PluginConfig.API.Functionals;
using TMPro;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Events;
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.EveryLight")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("2.0.0.0")]
[assembly: AssemblyInformationalVersion("2.0.0")]
[assembly: AssemblyProduct("EveryLight")]
[assembly: AssemblyTitle("bitmotte.EveryLight")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("2.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.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 EveryLight
{
	public static class Configurator
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static OnClick <0>__OpenDiscord;
		}

		public static BoolField visualizeHookGhosts;

		public static BoolField visualizeEarthmoverHookGhosts;

		public static ButtonField joinDC;

		public static PluginConfigurator CreateConfigurator()
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: 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_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Expected O, but got Unknown
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Expected O, but got Unknown
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Expected O, but got Unknown
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Expected O, but got Unknown
			//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_00bb: Expected O, but got Unknown
			PluginConfigurator val = PluginConfigurator.Create("EveryLight", "bitmotte.EveryLight");
			visualizeHookGhosts = new BoolField(val.rootPanel, "Visualize hook ghosts", "hg.vis", false);
			visualizeEarthmoverHookGhosts = new BoolField(val.rootPanel, "Visualize Earthmover hook ghosts", "hge.vis", true);
			ConfigSpace val2 = new ConfigSpace(val.rootPanel, 15f);
			ConfigHeader val3 = new ConfigHeader(val.rootPanel, "Join my discord for sneak peeks,devlogs,and the possibility to test my mods early ! !", 20, (TextAlignmentOptions)513);
			joinDC = new ButtonField(val.rootPanel, "Join my Discord", "joinDC");
			ConfigSpace val4 = new ConfigSpace(val.rootPanel, 15f);
			ButtonField obj = joinDC;
			object obj2 = <>O.<0>__OpenDiscord;
			if (obj2 == null)
			{
				OnClick val5 = OpenDiscord;
				<>O.<0>__OpenDiscord = val5;
				obj2 = (object)val5;
			}
			obj.onClick += (OnClick)obj2;
			return val;
		}

		private static void OpenDiscord()
		{
			Process.Start("http://discord.gg/pVdr9e6hZ8");
		}
	}
	internal static class MeshMaker
	{
		public static Mesh CreateCubeMesh()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_001e: 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_0039: 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_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_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_008a: 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_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: 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_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			Mesh val = new Mesh();
			Vector3[] vertices = (Vector3[])(object)new Vector3[8]
			{
				new Vector3(-0.5f, -0.5f, -0.5f),
				new Vector3(0.5f, -0.5f, -0.5f),
				new Vector3(0.5f, 0.5f, -0.5f),
				new Vector3(-0.5f, 0.5f, -0.5f),
				new Vector3(-0.5f, -0.5f, 0.5f),
				new Vector3(0.5f, -0.5f, 0.5f),
				new Vector3(0.5f, 0.5f, 0.5f),
				new Vector3(-0.5f, 0.5f, 0.5f)
			};
			int[] triangles = new int[36]
			{
				0, 2, 1, 0, 3, 2, 4, 5, 6, 4,
				6, 7, 0, 1, 5, 0, 5, 4, 2, 3,
				7, 2, 7, 6, 0, 4, 7, 0, 7, 3,
				1, 2, 6, 1, 6, 5
			};
			val.vertices = vertices;
			val.triangles = triangles;
			val.RecalculateNormals();
			return val;
		}
	}
	[HarmonyPatch(typeof(HookArm), "Start")]
	public class WeightPatch
	{
		private static void Postfix(HookArm __instance)
		{
			__instance.lightEnemies.Add((EnemyType)37);
			__instance.lightEnemies.Add((EnemyType)23);
			__instance.lightEnemies.Add((EnemyType)35);
			__instance.lightEnemies.Add((EnemyType)0);
			__instance.lightEnemies.Add((EnemyType)39);
			__instance.lightEnemies.Add((EnemyType)1);
			__instance.lightEnemies.Add((EnemyType)26);
			__instance.lightEnemies.Add((EnemyType)3);
			__instance.lightEnemies.Add((EnemyType)30);
			__instance.lightEnemies.Add((EnemyType)17);
			__instance.lightEnemies.Add((EnemyType)16);
			__instance.lightEnemies.Add((EnemyType)28);
			__instance.lightEnemies.Add((EnemyType)42);
			__instance.lightEnemies.Add((EnemyType)33);
			__instance.lightEnemies.Add((EnemyType)34);
			__instance.lightEnemies.Add((EnemyType)2);
			__instance.lightEnemies.Add((EnemyType)21);
			__instance.lightEnemies.Add((EnemyType)27);
			__instance.lightEnemies.Add((EnemyType)4);
			__instance.lightEnemies.Add((EnemyType)4);
			__instance.lightEnemies.Add((EnemyType)25);
			__instance.lightEnemies.Add((EnemyType)31);
			__instance.lightEnemies.Add((EnemyType)5);
			__instance.lightEnemies.Add((EnemyType)11);
			__instance.lightEnemies.Add((EnemyType)18);
			__instance.lightEnemies.Add((EnemyType)32);
			__instance.lightEnemies.Add((EnemyType)41);
			__instance.lightEnemies.Add((EnemyType)40);
			__instance.lightEnemies.Add((EnemyType)38);
			__instance.lightEnemies.Add((EnemyType)36);
			__instance.lightEnemies.Add((EnemyType)14);
			__instance.lightEnemies.Add((EnemyType)19);
			__instance.lightEnemies.Add((EnemyType)29);
			__instance.lightEnemies.Add((EnemyType)15);
			__instance.lightEnemies.Add((EnemyType)12);
			__instance.lightEnemies.Add((EnemyType)13);
			__instance.lightEnemies.Add((EnemyType)6);
			__instance.lightEnemies.Add((EnemyType)7);
			__instance.lightEnemies.Add((EnemyType)20);
			__instance.lightEnemies.Add((EnemyType)8);
			__instance.lightEnemies.Add((EnemyType)22);
			__instance.lightEnemies.Add((EnemyType)24);
			__instance.lightEnemies.Add((EnemyType)9);
			__instance.lightEnemies.Add((EnemyType)10);
		}
	}
	[HarmonyPatch(typeof(EnemyIdentifier), "Start")]
	public class PullUnpullablesPatch
	{
		private static void Postfix(EnemyIdentifier __instance)
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Invalid comparison between Unknown and I4
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Invalid comparison between Unknown and I4
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Invalid comparison between Unknown and I4
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Invalid comparison between Unknown and I4
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Invalid comparison between Unknown and I4
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Invalid comparison between Unknown and I4
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: 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_004f: Invalid comparison between Unknown and I4
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: Invalid comparison between Unknown and I4
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: 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: Invalid comparison between Unknown and I4
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_0177: Invalid comparison between Unknown and I4
			//IL_014b: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0164: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Invalid comparison between Unknown and I4
			//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Invalid comparison between Unknown and I4
			//IL_0183: 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_019c: 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_006d: Invalid comparison between Unknown and I4
			//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e9: Invalid comparison between Unknown and I4
			//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: 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_0077: Invalid comparison between Unknown and I4
			//IL_021b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0222: Invalid comparison between Unknown and I4
			//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0209: Unknown result type (might be due to invalid IL or missing references)
			//IL_020e: 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_0081: Invalid comparison between Unknown and I4
			//IL_0254: Unknown result type (might be due to invalid IL or missing references)
			//IL_025b: Invalid comparison between Unknown and I4
			//IL_022e: 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_0247: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Invalid comparison between Unknown and I4
			//IL_0277: Unknown result type (might be due to invalid IL or missing references)
			//IL_027e: Invalid comparison between Unknown and I4
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Invalid comparison between Unknown and I4
			//IL_02af: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b9: Expected O, but got Unknown
			//IL_02e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0300: Unknown result type (might be due to invalid IL or missing references)
			//IL_0314: Unknown result type (might be due to invalid IL or missing references)
			//IL_0320: Unknown result type (might be due to invalid IL or missing references)
			//IL_032c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0336: 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_03d0: Expected O, but got Unknown
			//IL_03d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d8: Expected O, but got Unknown
			//IL_03e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ec: Expected O, but got Unknown
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Invalid comparison between Unknown and I4
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Invalid comparison between Unknown and I4
			if (((Object)((Component)__instance).gameObject).name.Contains("Hook Ghost") || ((int)__instance.enemyType != 19 && (int)__instance.enemyType != 7 && (int)__instance.enemyType != 5 && (int)__instance.enemyType != 4 && (int)__instance.enemyType != 2 && (int)__instance.enemyType != 21 && (int)__instance.enemyType != 32 && (int)__instance.enemyType != 39 && (int)__instance.enemyType != 16 && (int)__instance.enemyType != 28 && (int)__instance.enemyType != 23 && (int)__instance.enemyType != 24 && (int)__instance.enemyType != 17 && (int)__instance.enemyType != 30))
			{
				return;
			}
			Bounds bounds = ((Component)__instance).gameObject.GetComponentInChildren<Renderer>().bounds;
			if ((int)__instance.enemyType == 19)
			{
				((Bounds)(ref bounds)).size = ((Bounds)(ref bounds)).size + new Vector3(0f, 11f, 0f);
			}
			if ((int)__instance.enemyType == 7)
			{
				((Bounds)(ref bounds)).size = ((Bounds)(ref bounds)).size + new Vector3(2f, 14f, 1f);
			}
			if ((int)__instance.enemyType == 5)
			{
				((Bounds)(ref bounds)).size = ((Bounds)(ref bounds)).size + new Vector3(10f, 20f, 15f);
			}
			if ((int)__instance.enemyType == 2)
			{
				((Bounds)(ref bounds)).size = ((Bounds)(ref bounds)).size + new Vector3(10f, 20f, 15f);
			}
			if ((int)__instance.enemyType == 21)
			{
				((Bounds)(ref bounds)).size = ((Bounds)(ref bounds)).size + new Vector3(0f, 6f, 0f);
			}
			if ((int)__instance.enemyType == 32)
			{
				((Bounds)(ref bounds)).size = ((Bounds)(ref bounds)).size + new Vector3(15f, 23f, 20f);
			}
			if ((int)__instance.enemyType == 39)
			{
				((Bounds)(ref bounds)).size = ((Bounds)(ref bounds)).size + new Vector3(0f, 5f, 0f);
			}
			if ((int)__instance.enemyType == 17)
			{
				Rigidbody val = ((Component)__instance).gameObject.AddComponent<Rigidbody>();
				return;
			}
			if ((int)__instance.enemyType == 30)
			{
				Rigidbody val2 = ((Component)__instance).gameObject.AddComponent<Rigidbody>();
				return;
			}
			AssetBundle val3 = BundleTool.Load("main_assets_all.bundle");
			GameObject val4 = Object.Instantiate<GameObject>((GameObject)val3.LoadAsset("Assets/ModTechnicalName/Hook Ghost.prefab"));
			val3.Unload(false);
			((Object)val4).name = __instance.FullName + " Hook Ghost";
			val4.transform.position = ((Component)__instance).transform.position;
			val4.transform.rotation = ((Component)__instance).transform.rotation;
			val4.transform.localScale = new Vector3(((Bounds)(ref bounds)).size.x, ((Bounds)(ref bounds)).size.y, ((Bounds)(ref bounds)).size.z);
			HookGhost hookGhost = val4.AddComponent<HookGhost>();
			CopyPositionAndRotation val5 = ((Component)__instance).gameObject.AddComponent<CopyPositionAndRotation>();
			val5.target = ((Component)hookGhost).transform;
			val5.copyPosition = true;
			val5.copyRotation = true;
			hookGhost.otherCopy = val5;
			hookGhost.ownCopy = ((Component)hookGhost).GetComponent<CopyPositionAndRotation>();
			hookGhost.ownCopy.target = ((Component)__instance).transform;
			hookGhost.otherEid = __instance;
			hookGhost.ownEid = ((Component)hookGhost).GetComponent<EnemyIdentifier>();
			__instance.onDeath.AddListener(new UnityAction(hookGhost.DestroyMe));
			UnityEvent val6 = new UnityEvent();
			val6.AddListener(new UnityAction(hookGhost.DestroyMe));
			hookGhost.ownEid.onDeath = val6;
			hookGhost.ownEid.health = hookGhost.otherEid.health;
			hookGhost.ownEid.totalDamageTakenMultiplier = 1f;
			if (!Configurator.visualizeHookGhosts.value)
			{
				Object.Destroy((Object)(object)val4.GetComponentInChildren<MeshFilter>());
			}
		}
	}
	internal class HookGhost : EnemyScript
	{
		public EnemyIdentifier ownEid;

		public EnemyIdentifier otherEid;

		public CopyPositionAndRotation ownCopy;

		public CopyPositionAndRotation otherCopy;

		public void FixedUpdate()
		{
			if (!ownEid.hooked)
			{
				((Behaviour)ownCopy).enabled = true;
				((Behaviour)otherCopy).enabled = false;
			}
			else
			{
				((Behaviour)ownCopy).enabled = false;
				((Behaviour)otherCopy).enabled = true;
			}
		}

		public override void OnDamage(ref DamageData data)
		{
			Plugin.Logger.LogInfo((object)"Hello");
			otherEid.SimpleDamage(data.damage);
		}

		public void DestroyMe()
		{
			Object.Destroy((Object)(object)((Component)otherEid).gameObject);
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}
	internal class HookGhostCentaur : EnemyScript
	{
		public Rigidbody rb;

		public EnemyIdentifier ownEid;

		public CopyPositionAndRotation ownCopy;

		public CopyPositionAndRotation otherCopy;

		public void Start()
		{
			((MonoBehaviour)this).Invoke("UnCopy", 2f);
			rb = ((Component)this).GetComponent<Rigidbody>();
		}

		public void FixedUpdate()
		{
			if (!ownEid.hooked)
			{
				((Behaviour)ownCopy).enabled = true;
				((Behaviour)otherCopy).enabled = false;
			}
			else
			{
				((Behaviour)ownCopy).enabled = false;
				((Behaviour)otherCopy).enabled = true;
			}
		}

		private void UnCopy()
		{
			ownCopy.copyPosition = false;
			ownCopy.copyRotation = false;
		}
	}
	[BepInPlugin("bitmotte.EveryLight", "EveryLight", "2.0.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		internal static ManualLogSource Logger;

		public static PluginConfigurator config;

		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.EveryLight is loaded!");
			Harmony val = new Harmony("bitmotte.EveryLight");
			val.PatchAll();
			config = Configurator.CreateConfigurator();
			SceneManager.sceneLoaded += SceneUtility.OnSceneLoad;
		}
	}
	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("EveryLight.resources." + fileName))
			{
				if (stream == null)
				{
					return null;
				}
				array = new byte[stream.Length];
				stream.Read(array, 0, array.Length);
			}
			return array;
		}
	}
	public static class SceneUtility
	{
		public static string sceneName;

		public static void OnSceneLoad(Scene scene, LoadSceneMode mode)
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Expected O, but got Unknown
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Expected O, but got Unknown
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Expected O, but got Unknown
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Expected O, but got Unknown
			//IL_012b: 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_0164: 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_0184: Expected O, but got Unknown
			//IL_019f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_027f: Unknown result type (might be due to invalid IL or missing references)
			sceneName = ((Scene)(ref scene)).name;
			Plugin.Logger.LogInfo((object)sceneName);
			if (sceneName != "6e981b1865c649749a610aafc471e198")
			{
				return;
			}
			GameObject val = new GameObject();
			GameObject val2 = new GameObject();
			List<GameObject> list = new List<GameObject>();
			((Scene)(ref scene)).GetRootGameObjects(list);
			foreach (GameObject item in list)
			{
				if (((Object)item).name.Contains("Main"))
				{
					val = item;
					val2 = ((Component)item.transform.GetChild(2).GetChild(1).GetChild(0)
						.GetChild(0)
						.GetChild(0)
						.GetChild(3)).gameObject;
				}
			}
			AssetBundle val3 = BundleTool.Load("main_assets_all.bundle");
			GameObject val4 = Object.Instantiate<GameObject>((GameObject)val3.LoadAsset("Assets/ModTechnicalName/Hook Ghost Centaur.prefab"));
			GameObject val5 = Object.Instantiate<GameObject>((GameObject)val3.LoadAsset("Assets/ModTechnicalName/Earthmover Warning.prefab"));
			val3.Unload(false);
			((Object)val4).name = "EARTHMOVER Hook Ghost";
			val4.transform.position = val.transform.position;
			val4.transform.rotation = val.transform.rotation;
			val4.transform.localScale = new Vector3(500f, 500f, 500f);
			HookGhostCentaur hookGhostCentaur = val4.AddComponent<HookGhostCentaur>();
			GameObject val6 = new GameObject("Other Target");
			val6.transform.parent = val4.transform;
			val6.transform.position = Vector3.zero;
			val6.transform.rotation = val.transform.rotation;
			CopyPositionAndRotation val7 = val.gameObject.AddComponent<CopyPositionAndRotation>();
			val7.target = val6.transform;
			val7.copyPosition = true;
			val7.copyRotation = true;
			hookGhostCentaur.otherCopy = val7;
			hookGhostCentaur.ownCopy = ((Component)hookGhostCentaur).GetComponent<CopyPositionAndRotation>();
			hookGhostCentaur.ownCopy.target = val2.transform;
			val4.GetComponent<Rigidbody>().useGravity = false;
			hookGhostCentaur.ownEid = ((Component)hookGhostCentaur).GetComponent<EnemyIdentifier>();
			hookGhostCentaur.ownEid.totalDamageTakenMultiplier = 0f;
			if (!Configurator.visualizeEarthmoverHookGhosts.value)
			{
				Object.Destroy((Object)(object)val4.GetComponentInChildren<MeshFilter>());
			}
			val5.transform.position = new Vector3(-3.8236f, 0.5127f, 362.3046f);
		}
	}
	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_0066: 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_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
			Shader shader = Addressables.LoadAssetAsync<Material>((object)"Assets/Materials/Environment/Metal/Pattern 1/Metal Pattern 1 8.mat").WaitForCompletion().shader;
			SkinnedMeshRenderer[] componentsInChildren = gameObject.GetComponentsInChildren<SkinnedMeshRenderer>();
			foreach (SkinnedMeshRenderer val in componentsInChildren)
			{
				Material[] materials = ((Renderer)val).materials;
				foreach (Material val2 in materials)
				{
					if (((Object)val2.shader).name == "Hidden/InternalErrorShader")
					{
						val2.shader = Addressables.LoadAssetAsync<Material>((object)"Assets/Materials/Dev/FadeToWhite.mat").WaitForCompletion().shader;
					}
					else
					{
						val2.shader = shader;
					}
				}
			}
			MeshRenderer[] componentsInChildren2 = gameObject.GetComponentsInChildren<MeshRenderer>();
			foreach (MeshRenderer val3 in componentsInChildren2)
			{
				Material[] materials2 = ((Renderer)val3).materials;
				foreach (Material val4 in materials2)
				{
					if (((Object)val4.shader).name == "Hidden/InternalErrorShader")
					{
						val4.shader = Addressables.LoadAssetAsync<Material>((object)"Assets/Materials/Dev/FadeToWhite.mat").WaitForCompletion().shader;
					}
					else
					{
						val4.shader = shader;
					}
				}
			}
			ParticleSystem[] componentsInChildren3 = gameObject.GetComponentsInChildren<ParticleSystem>();
			foreach (ParticleSystem val5 in componentsInChildren3)
			{
				Renderer[] componentsInChildren4 = ((Component)val5).gameObject.GetComponentsInChildren<Renderer>();
				foreach (Renderer val6 in componentsInChildren4)
				{
					Material[] materials3 = val6.materials;
					foreach (Material val7 in materials3)
					{
						if (((Object)val7.shader).name == "Hidden/InternalErrorShader")
						{
							val7.shader = Addressables.LoadAssetAsync<Material>((object)"Assets/Materials/Dev/FadeToWhite.mat").WaitForCompletion().shader;
						}
						else
						{
							val7.shader = shader;
						}
					}
				}
			}
			return gameObject;
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "bitmotte.EveryLight";

		public const string PLUGIN_NAME = "EveryLight";

		public const string PLUGIN_VERSION = "2.0.0";
	}
}