Decompiled source of DivideByZero v0.0.1

DivideByZero.dll

Decompiled a week ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using PluginConfig.API;
using PluginConfig.API.Decorators;
using PluginConfig.API.Fields;
using UnityEngine;
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: AssemblyTitle("DivideByZero")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DivideByZero")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("1ff5f4d5-d1f7-4c27-956b-9ae7e7e8ab36")]
[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 DivideByZero;

public enum LogType
{
	Log,
	Warning,
	Error,
	Success
}
public class ValueIntField
{
	public string name;

	public int originalValue;

	public FieldInfo fieldInfo;

	public Component component;

	public void SetValue(int value)
	{
		fieldInfo.SetValue(component, value);
	}
}
public class ValueFloatField
{
	public string name;

	public float originalValue;

	public FieldInfo fieldInfo;

	public Component component;

	public void SetValue(float value)
	{
		fieldInfo.SetValue(component, value);
	}
}
[BepInPlugin("com.d1g1tal.dividebyzero", "DivideByZero", "0.0.1")]
public class DividePlugin : BaseUnityPlugin
{
	[CompilerGenerated]
	private sealed class <DoTheFunny>d__17 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

		public DividePlugin <>4__this;

		private ValueFloatField <randFloat>5__1;

		private ValueIntField <randInt>5__2;

		private List<ValueFloatField>.Enumerator <>s__3;

		private ValueFloatField <f>5__4;

		private List<ValueIntField>.Enumerator <>s__5;

		private ValueIntField <i>5__6;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <DoTheFunny>d__17(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<randFloat>5__1 = null;
			<randInt>5__2 = null;
			<>s__3 = default(List<ValueFloatField>.Enumerator);
			<f>5__4 = null;
			<>s__5 = default(List<ValueIntField>.Enumerator);
			<i>5__6 = null;
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				if (foundFloats.First() == null)
				{
					on = false;
					return false;
				}
				if (foundInts.First() == null)
				{
					on = false;
					return false;
				}
				<randFloat>5__1 = foundFloats[Random.Range(1, foundFloats.Count)];
				<randInt>5__2 = foundInts[Random.Range(1, foundInts.Count)];
				on = true;
				<>s__3 = foundFloats.GetEnumerator();
				try
				{
					while (<>s__3.MoveNext())
					{
						<f>5__4 = <>s__3.Current;
						<f>5__4.SetValue(<>4__this.RandomMathfValue((float)<f>5__4.fieldInfo.GetValue(<f>5__4.component), <f>5__4.originalValue, MultAmount.value));
						<f>5__4 = null;
					}
				}
				finally
				{
					((IDisposable)<>s__3).Dispose();
				}
				<>s__3 = default(List<ValueFloatField>.Enumerator);
				<>s__5 = foundInts.GetEnumerator();
				try
				{
					while (<>s__5.MoveNext())
					{
						<i>5__6 = <>s__5.Current;
						<i>5__6.SetValue(<>4__this.RandomMathValueInt((int)<i>5__6.fieldInfo.GetValue(<i>5__6.component), <i>5__6.originalValue, (int)MultAmount.value));
						<i>5__6 = null;
					}
				}
				finally
				{
					((IDisposable)<>s__5).Dispose();
				}
				<>s__5 = default(List<ValueIntField>.Enumerator);
				<>2__current = null;
				<>1__state = 1;
				return true;
			case 1:
				<>1__state = -1;
				return false;
			}
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	public static PluginConfigurator config = PluginConfigurator.Create("DivideByZero", "com.d1g1tal.dividebyzero");

	public static ConfigHeader Warning = new ConfigHeader(config.rootPanel, "Play on a save you <color=red>DON'T</color> care about \n<color=grey>(or a backup of your main save)</color> before playing this mod.\nIf you want to <color=orange>fully reset</color> these <color=orange>changes</color>, <color=orange>Restart</color> the game.", 24);

	public static KeyCodeField EnableKey = new KeyCodeField(config.rootPanel, "Enable key", "2", (KeyCode)44);

	public static BoolField Enabled = new BoolField(config.rootPanel, "Mod enabled", "3", true);

	public static FloatField MultAmount = new FloatField(config.rootPanel, "Corruption multiplier", "5", 3f);

	public static KeyCodeField RestartButton = new KeyCodeField(config.rootPanel, "Restart key", "6", (KeyCode)46);

	public static List<ValueFloatField> foundFloats = new List<ValueFloatField>();

	public static List<ValueIntField> foundInts = new List<ValueIntField>();

	private List<string> ignore = new List<string> { "volume", "targetHeight", "walkSpeed", "jumpPower" };

	private int maxLength = 30;

	public static bool on;

	private void Awake()
	{
		SceneManager.sceneLoaded += OnSceneLoaded;
		config.SetIconWithURL("file://" + Path.Combine(Directory.GetParent(((BaseUnityPlugin)this).Info.Location).FullName, "icon.png"));
	}

	private void Update()
	{
		//IL_0006: 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)
		if (Input.GetKeyDown(RestartButton.value))
		{
			SceneHelper.LoadScene(SceneHelper.CurrentScene, false);
		}
		if (Input.GetKeyDown(EnableKey.value) && Enabled.value)
		{
			TurnOn();
		}
	}

	private void OnSceneLoaded(Scene arg0, LoadSceneMode loadSceneMode)
	{
		foundFloats.Clear();
		foundInts.Clear();
		on = false;
	}

	private void TurnOn()
	{
		if (FindValues())
		{
			((MonoBehaviour)this).StartCoroutine(DoTheFunny());
			on = true;
		}
	}

	private float RandomMathfValue(float value, float originalValue, float multiplier)
	{
		return Random.Range(0, 4) switch
		{
			0 => (Mathf.Sin(value) * multiplier <= 0f) ? (originalValue * multiplier) : (originalValue * multiplier * multiplier), 
			1 => (Mathf.Cos(value) * multiplier <= 0f) ? (originalValue * multiplier) : (Mathf.Cos(value) * multiplier), 
			2 => (Mathf.Sqrt(value) * multiplier <= 0f) ? (originalValue * multiplier) : (Mathf.Sqrt(value) * multiplier), 
			3 => (Mathf.PingPong(value, 2f * multiplier) * multiplier <= 0f) ? (originalValue * multiplier) : (Mathf.PingPong(value, 2f * multiplier) * multiplier), 
			4 => (Mathf.Repeat(value, 2f * multiplier) * multiplier <= 0f) ? (originalValue * multiplier) : (Mathf.Repeat(value, 2f * multiplier) * multiplier), 
			_ => originalValue * multiplier, 
		};
	}

	private int RandomMathValueInt(int value, int originalValue, int multiplier)
	{
		return Random.Range(0, 4) switch
		{
			0 => (Mathf.Sin((float)value) * (float)multiplier <= 0f) ? (originalValue * multiplier) : (originalValue * multiplier * multiplier), 
			1 => (Mathf.Cos((float)value) * (float)multiplier <= 0f) ? (originalValue * multiplier) : ((int)(Mathf.Cos((float)value) * (float)multiplier)), 
			2 => (Mathf.Sqrt((float)value) * (float)multiplier <= 0f) ? (originalValue * multiplier) : ((int)(Mathf.Sqrt((float)value) * (float)multiplier)), 
			3 => (Mathf.PingPong((float)value, (float)(2 * multiplier)) * (float)multiplier <= 0f) ? (originalValue * multiplier) : ((int)(Mathf.PingPong((float)value, (float)(2 * multiplier)) * (float)multiplier)), 
			4 => (Mathf.Repeat((float)value, (float)(2 * multiplier)) * (float)multiplier <= 0f) ? (originalValue * multiplier) : ((int)(Mathf.Repeat((float)value, (float)(2 * multiplier)) * (float)multiplier)), 
			_ => originalValue * multiplier, 
		};
	}

	[IteratorStateMachine(typeof(<DoTheFunny>d__17))]
	private IEnumerator DoTheFunny()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <DoTheFunny>d__17(0)
		{
			<>4__this = this
		};
	}

	public void LogIngame(LogType logType, string msg)
	{
		HudMessageReceiver instance = MonoSingleton<HudMessageReceiver>.Instance;
		switch (logType)
		{
		case LogType.Log:
			instance.SendHudMessage(msg, "", "", 0, false, false, true);
			break;
		case LogType.Error:
			instance.SendHudMessage("<color=red>" + msg + "</color>", "", "", 0, false, false, true);
			break;
		case LogType.Warning:
			instance.SendHudMessage("<color=yellow>" + msg + "</color>", "", "", 0, false, false, true);
			break;
		case LogType.Success:
			instance.SendHudMessage("<color=green>" + msg + "</color>", "", "", 0, false, false, true);
			break;
		}
		Debug.Log((object)msg);
	}

	public Component[] GetEverything()
	{
		//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)
		Scene activeScene = SceneManager.GetActiveScene();
		GameObject[] rootGameObjects = ((Scene)(ref activeScene)).GetRootGameObjects();
		List<Component> list = new List<Component>();
		GameObject[] array = rootGameObjects;
		foreach (GameObject val in array)
		{
			Component[] componentsInChildren = val.GetComponentsInChildren<Component>(true);
			list.AddRange(componentsInChildren);
		}
		if (list.Count > maxLength)
		{
			list.Take(maxLength);
		}
		return list.ToArray();
	}

	public bool FindValues()
	{
		//IL_0bbc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bc3: Expected O, but got Unknown
		//IL_0bf4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bf9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bfe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c05: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c23: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c2a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c48: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c4f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c71: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d4b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d50: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e19: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e1e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e25: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e31: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e4d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e59: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e75: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e81: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e9a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0eaa: Unknown result type (might be due to invalid IL or missing references)
		//IL_0eb6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ed2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ede: Unknown result type (might be due to invalid IL or missing references)
		//IL_0efa: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f06: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f1f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f6e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f73: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fe0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fe5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fea: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ff1: Unknown result type (might be due to invalid IL or missing references)
		//IL_1008: Unknown result type (might be due to invalid IL or missing references)
		//IL_100f: Unknown result type (might be due to invalid IL or missing references)
		//IL_1026: Unknown result type (might be due to invalid IL or missing references)
		//IL_102d: 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_0400: Expected O, but got Unknown
		//IL_0431: Unknown result type (might be due to invalid IL or missing references)
		//IL_0436: Unknown result type (might be due to invalid IL or missing references)
		//IL_043b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0442: Unknown result type (might be due to invalid IL or missing references)
		//IL_0460: Unknown result type (might be due to invalid IL or missing references)
		//IL_0467: Unknown result type (might be due to invalid IL or missing references)
		//IL_0485: Unknown result type (might be due to invalid IL or missing references)
		//IL_048c: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_1090: Unknown result type (might be due to invalid IL or missing references)
		//IL_1095: Unknown result type (might be due to invalid IL or missing references)
		//IL_109a: Unknown result type (might be due to invalid IL or missing references)
		//IL_10a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_10b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_10bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_10d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_10dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_10f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_10fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0589: Unknown result type (might be due to invalid IL or missing references)
		//IL_058e: Unknown result type (might be due to invalid IL or missing references)
		//IL_115e: Unknown result type (might be due to invalid IL or missing references)
		//IL_1163: Unknown result type (might be due to invalid IL or missing references)
		//IL_1168: Unknown result type (might be due to invalid IL or missing references)
		//IL_116f: Unknown result type (might be due to invalid IL or missing references)
		//IL_118d: Unknown result type (might be due to invalid IL or missing references)
		//IL_1194: Unknown result type (might be due to invalid IL or missing references)
		//IL_11b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_11b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_11d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_11de: Unknown result type (might be due to invalid IL or missing references)
		//IL_0658: Unknown result type (might be due to invalid IL or missing references)
		//IL_065d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0664: Unknown result type (might be due to invalid IL or missing references)
		//IL_0670: Unknown result type (might be due to invalid IL or missing references)
		//IL_068c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0698: Unknown result type (might be due to invalid IL or missing references)
		//IL_06b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_06c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_06d9: Unknown result type (might be due to invalid IL or missing references)
		//IL_06e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_06f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0711: Unknown result type (might be due to invalid IL or missing references)
		//IL_071d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0739: Unknown result type (might be due to invalid IL or missing references)
		//IL_0745: Unknown result type (might be due to invalid IL or missing references)
		//IL_075e: Unknown result type (might be due to invalid IL or missing references)
		//IL_07ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_07b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0821: Unknown result type (might be due to invalid IL or missing references)
		//IL_0826: Unknown result type (might be due to invalid IL or missing references)
		//IL_082b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0832: Unknown result type (might be due to invalid IL or missing references)
		//IL_0849: Unknown result type (might be due to invalid IL or missing references)
		//IL_0850: Unknown result type (might be due to invalid IL or missing references)
		//IL_0867: Unknown result type (might be due to invalid IL or missing references)
		//IL_086e: Unknown result type (might be due to invalid IL or missing references)
		//IL_08d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_08d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_08dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_08e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_08fa: 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_0918: Unknown result type (might be due to invalid IL or missing references)
		//IL_091f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0936: Unknown result type (might be due to invalid IL or missing references)
		//IL_093d: Unknown result type (might be due to invalid IL or missing references)
		//IL_09a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_09a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_09ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_09b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_09d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_09d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_09f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_09fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a1a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a21: Unknown result type (might be due to invalid IL or missing references)
		Component[] everything = GetEverything();
		foundFloats.Clear();
		foundInts.Clear();
		Component[] array = everything;
		foreach (Component val in array)
		{
			if ((Object)(object)val == (Object)null)
			{
				continue;
			}
			Type type = ((object)val).GetType();
			if (type == typeof(WeaponIdentifier) || type == typeof(ActivateArena) || type == typeof(CameraController) || type == typeof(ActivateNextWave) || type == typeof(Door) || type == typeof(TimeController) || type == typeof(AudioListener) || type == typeof(PostProcessV2_Handler) || type == typeof(DeathZone) || type == typeof(DeathMarker) || type == typeof(DoorOpener) || type == typeof(DoorController) || type == typeof(FinalDoorOpener))
			{
				Debug.Log((object)"Skip");
				continue;
			}
			FieldInfo[] fields = type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
			foreach (FieldInfo fieldInfo in fields)
			{
				try
				{
					if (fieldInfo.FieldType == typeof(GameObject) || fieldInfo.FieldType == typeof(Transform))
					{
						object value = fieldInfo.GetValue(val);
						GameObject val2 = null;
						GameObject val3 = (GameObject)((value is GameObject) ? value : null);
						if (val3 != null)
						{
							val2 = val3;
						}
						Transform val4 = (Transform)((value is Transform) ? value : null);
						if (val4 != null)
						{
							val2 = ((Component)val4).gameObject;
						}
						if ((Object)(object)val2 != (Object)null)
						{
							Component[] componentsInChildren = val2.GetComponentsInChildren<Component>(true);
							List<Component> list = new List<Component>();
							list.AddRange(val2.GetComponents<Component>());
							list.AddRange(componentsInChildren);
							foreach (Component item5 in list)
							{
								if ((Object)(object)item5 == (Object)null)
								{
									continue;
								}
								Type type2 = ((object)item5).GetType();
								if (type2 == typeof(WeaponIdentifier) || type2 == typeof(ActivateArena) || type2 == typeof(CameraController) || type2 == typeof(ActivateNextWave) || type2 == typeof(Door) || type2 == typeof(TimeController) || type2 == typeof(AudioListener) || type2 == typeof(SpiderBody) || type2 == typeof(DeathZone) || type2 == typeof(DeathMarker) || type2 == typeof(DoorOpener) || type2 == typeof(DoorController) || type2 == typeof(FinalDoorOpener))
								{
									Debug.Log((object)"Skip");
									continue;
								}
								FieldInfo[] fields2 = type2.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
								foreach (FieldInfo fieldInfo2 in fields2)
								{
									if (fieldInfo2.FieldType == typeof(Material) && !ignore.Contains(fieldInfo2.Name))
									{
										Material val5 = (Material)fieldInfo2.GetValue(item5);
										if ((Object)(object)val5 == (Object)null)
										{
											continue;
										}
										if (val5.HasProperty("_Color"))
										{
											Color color = val5.GetColor("_Color");
											color.r = RandomMathfValue(color.r, color.r, MultAmount.value);
											color.g = RandomMathfValue(color.g, color.g, MultAmount.value);
											color.b = RandomMathfValue(color.b, color.b, MultAmount.value);
											val5.SetColor("_Color", color);
										}
										if (val5.HasProperty("_Metallic"))
										{
											float @float = val5.GetFloat("_Metallic");
											@float = RandomMathfValue(@float, @float, MultAmount.value);
											val5.SetFloat("_Metallic", @float);
										}
										if (val5.HasProperty("_Glossiness"))
										{
											float float2 = val5.GetFloat("_Glossiness");
											float2 = RandomMathfValue(float2, float2, MultAmount.value);
											val5.SetFloat("_Glossiness", float2);
										}
									}
									if (fieldInfo2.FieldType == typeof(Rect) && !ignore.Contains(fieldInfo2.Name))
									{
										Rect val6 = (Rect)fieldInfo2.GetValue(item5);
										((Rect)(ref val6)).Set(RandomMathfValue(((Rect)(ref val6)).x, ((Rect)(ref val6)).x, MultAmount.value), RandomMathfValue(((Rect)(ref val6)).y, ((Rect)(ref val6)).y, MultAmount.value), RandomMathfValue(((Rect)(ref val6)).width, ((Rect)(ref val6)).width, MultAmount.value), RandomMathfValue(((Rect)(ref val6)).height, ((Rect)(ref val6)).height, MultAmount.value));
									}
									else if (fieldInfo2.FieldType == typeof(Bounds) && !ignore.Contains(fieldInfo2.Name))
									{
										Bounds val7 = (Bounds)fieldInfo2.GetValue(item5);
										((Bounds)(ref val7)).center = new Vector3(RandomMathfValue(((Bounds)(ref val7)).center.x, ((Bounds)(ref val7)).center.x, MultAmount.value), RandomMathfValue(((Bounds)(ref val7)).center.y, ((Bounds)(ref val7)).center.y, MultAmount.value), RandomMathfValue(((Bounds)(ref val7)).center.z, ((Bounds)(ref val7)).center.z, MultAmount.value));
										((Bounds)(ref val7)).size = new Vector3(RandomMathfValue(((Bounds)(ref val7)).size.x, ((Bounds)(ref val7)).size.x, MultAmount.value), RandomMathfValue(((Bounds)(ref val7)).size.y, ((Bounds)(ref val7)).size.y, MultAmount.value), RandomMathfValue(((Bounds)(ref val7)).size.z, ((Bounds)(ref val7)).size.z, MultAmount.value));
									}
									else if (fieldInfo2.FieldType == typeof(LayerMask) && !ignore.Contains(fieldInfo2.Name))
									{
										LayerMask val8 = (LayerMask)fieldInfo2.GetValue(item5);
										((LayerMask)(ref val8)).value = RandomMathValueInt(((LayerMask)(ref val8)).value, ((LayerMask)(ref val8)).value, (int)MultAmount.value);
									}
									else if (fieldInfo2.FieldType == typeof(Vector3) && !ignore.Contains(fieldInfo2.Name))
									{
										Vector3 val9 = (Vector3)fieldInfo2.GetValue(item5);
										((Vector3)(ref val9)).Set(RandomMathfValue(val9.x, val9.x, MultAmount.value), RandomMathfValue(val9.y, val9.y, MultAmount.value), RandomMathfValue(val9.z, val9.z, MultAmount.value));
									}
									else if (fieldInfo2.FieldType == typeof(Quaternion) && !ignore.Contains(fieldInfo2.Name))
									{
										Quaternion val10 = (Quaternion)fieldInfo2.GetValue(item5);
										((Quaternion)(ref val10)).Set(RandomMathfValue(val10.x, val10.x, MultAmount.value), RandomMathfValue(val10.y, val10.y, MultAmount.value), RandomMathfValue(val10.z, val10.z, MultAmount.value), RandomMathfValue(val10.w, val10.w, MultAmount.value));
									}
									else if (fieldInfo2.FieldType == typeof(Color) && !ignore.Contains(fieldInfo2.Name))
									{
										Color val11 = (Color)fieldInfo2.GetValue(item5);
										val11.r = RandomMathfValue(val11.r, val11.r, MultAmount.value);
										val11.g = RandomMathfValue(val11.g, val11.g, MultAmount.value);
										val11.b = RandomMathfValue(val11.b, val11.b, MultAmount.value);
										val11.a = RandomMathfValue(val11.a, val11.a, MultAmount.value);
									}
									else if (fieldInfo2.FieldType == typeof(float) && !ignore.Contains(fieldInfo2.Name))
									{
										float originalValue = (float)fieldInfo2.GetValue(item5);
										ValueFloatField item = new ValueFloatField
										{
											originalValue = originalValue,
											name = fieldInfo2.Name,
											fieldInfo = fieldInfo2,
											component = item5
										};
										foundFloats.Add(item);
									}
									else if (fieldInfo2.FieldType == typeof(int) && !ignore.Contains(fieldInfo2.Name))
									{
										int originalValue2 = (int)fieldInfo2.GetValue(item5);
										ValueIntField item2 = new ValueIntField
										{
											originalValue = originalValue2,
											name = fieldInfo2.Name,
											fieldInfo = fieldInfo2,
											component = item5
										};
										foundInts.Add(item2);
									}
								}
							}
						}
					}
					if (!(fieldInfo.FieldType == typeof(Material)) || ignore.Contains(fieldInfo.Name))
					{
						goto IL_0d09;
					}
					Material val12 = (Material)fieldInfo.GetValue(val);
					if ((Object)(object)val12 == (Object)null)
					{
						continue;
					}
					if (val12.HasProperty("_Color"))
					{
						Color color2 = val12.GetColor("_Color");
						color2.r = RandomMathfValue(color2.r, color2.r, MultAmount.value);
						color2.g = RandomMathfValue(color2.g, color2.g, MultAmount.value);
						color2.b = RandomMathfValue(color2.b, color2.b, MultAmount.value);
						val12.SetColor("_Color", color2);
					}
					if (val12.HasProperty("_Metallic"))
					{
						float float3 = val12.GetFloat("_Metallic");
						float3 = RandomMathfValue(float3, float3, MultAmount.value);
						val12.SetFloat("_Metallic", float3);
					}
					if (val12.HasProperty("_Glossiness"))
					{
						float float4 = val12.GetFloat("_Glossiness");
						float4 = RandomMathfValue(float4, float4, MultAmount.value);
						val12.SetFloat("_Glossiness", float4);
					}
					goto IL_0d09;
					IL_0d09:
					if (fieldInfo.FieldType == typeof(Rect) && !ignore.Contains(fieldInfo.Name))
					{
						Rect val13 = (Rect)fieldInfo.GetValue(val);
						((Rect)(ref val13)).Set(RandomMathfValue(((Rect)(ref val13)).x, ((Rect)(ref val13)).x, MultAmount.value), RandomMathfValue(((Rect)(ref val13)).y, ((Rect)(ref val13)).y, MultAmount.value), RandomMathfValue(((Rect)(ref val13)).width, ((Rect)(ref val13)).width, MultAmount.value), RandomMathfValue(((Rect)(ref val13)).height, ((Rect)(ref val13)).height, MultAmount.value));
					}
					else if (fieldInfo.FieldType == typeof(Bounds) && !ignore.Contains(fieldInfo.Name))
					{
						Bounds val14 = (Bounds)fieldInfo.GetValue(val);
						((Bounds)(ref val14)).center = new Vector3(RandomMathfValue(((Bounds)(ref val14)).center.x, ((Bounds)(ref val14)).center.x, MultAmount.value), RandomMathfValue(((Bounds)(ref val14)).center.y, ((Bounds)(ref val14)).center.y, MultAmount.value), RandomMathfValue(((Bounds)(ref val14)).center.z, ((Bounds)(ref val14)).center.z, MultAmount.value));
						((Bounds)(ref val14)).size = new Vector3(RandomMathfValue(((Bounds)(ref val14)).size.x, ((Bounds)(ref val14)).size.x, MultAmount.value), RandomMathfValue(((Bounds)(ref val14)).size.y, ((Bounds)(ref val14)).size.y, MultAmount.value), RandomMathfValue(((Bounds)(ref val14)).size.z, ((Bounds)(ref val14)).size.z, MultAmount.value));
					}
					else if (fieldInfo.FieldType == typeof(LayerMask) && !ignore.Contains(fieldInfo.Name))
					{
						LayerMask val15 = (LayerMask)fieldInfo.GetValue(val);
						((LayerMask)(ref val15)).value = RandomMathValueInt(((LayerMask)(ref val15)).value, ((LayerMask)(ref val15)).value, (int)MultAmount.value);
					}
					else if (fieldInfo.FieldType == typeof(Vector3) && !ignore.Contains(fieldInfo.Name))
					{
						Vector3 val16 = (Vector3)fieldInfo.GetValue(val);
						((Vector3)(ref val16)).Set(RandomMathfValue(val16.x, val16.x, MultAmount.value), RandomMathfValue(val16.y, val16.y, MultAmount.value), RandomMathfValue(val16.z, val16.z, MultAmount.value));
					}
					else if (fieldInfo.FieldType == typeof(Quaternion) && !ignore.Contains(fieldInfo.Name))
					{
						Quaternion val17 = (Quaternion)fieldInfo.GetValue(val);
						((Quaternion)(ref val17)).Set(RandomMathfValue(val17.x, val17.x, MultAmount.value), RandomMathfValue(val17.y, val17.y, MultAmount.value), RandomMathfValue(val17.z, val17.z, MultAmount.value), RandomMathfValue(val17.w, val17.w, MultAmount.value));
					}
					else if (fieldInfo.FieldType == typeof(Color) && !ignore.Contains(fieldInfo.Name))
					{
						Color val18 = (Color)fieldInfo.GetValue(val);
						val18.r = RandomMathfValue(val18.r, val18.r, MultAmount.value);
						val18.g = RandomMathfValue(val18.g, val18.g, MultAmount.value);
						val18.b = RandomMathfValue(val18.b, val18.b, MultAmount.value);
						val18.a = RandomMathfValue(val18.a, val18.a, MultAmount.value);
					}
					else if (fieldInfo.FieldType == typeof(float) && !ignore.Contains(fieldInfo.Name))
					{
						float originalValue3 = (float)fieldInfo.GetValue(val);
						ValueFloatField item3 = new ValueFloatField
						{
							originalValue = originalValue3,
							name = fieldInfo.Name,
							fieldInfo = fieldInfo,
							component = val
						};
						foundFloats.Add(item3);
					}
					else if (fieldInfo.FieldType == typeof(int) && !ignore.Contains(fieldInfo.Name))
					{
						int originalValue4 = (int)fieldInfo.GetValue(val);
						ValueIntField item4 = new ValueIntField
						{
							originalValue = originalValue4,
							name = fieldInfo.Name,
							fieldInfo = fieldInfo,
							component = val
						};
						foundInts.Add(item4);
					}
				}
				catch (Exception ex)
				{
					LogIngame(LogType.Warning, "EXCEPTION CAUGHT DURING SEARCH: " + ex.ToString().ToUpper());
				}
			}
		}
		return foundFloats.Count > 0 || foundInts.Count > 0;
	}
}