Decompiled source of WEFreeCamera v1.3.2

plugins/WEFreeCamera.dll

Decompiled 6 months 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.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;

[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.0", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("WEFreeCamera")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("WEFreeCamera")]
[assembly: AssemblyTitle("WEFreeCamera")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.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 WEFreeCamera
{
	[BepInPlugin("GeeEM.WrestlingEmpire.WEFreeCamera", "WEFreeCamera", "1.3.2")]
	[HarmonyPatch]
	public class FreeCameraPlugin : BaseUnityPlugin
	{
		public const string PluginGuid = "GeeEM.WrestlingEmpire.WEFreeCamera";

		public const string PluginName = "WEFreeCamera";

		public const string PluginVer = "1.3.2";

		internal static ManualLogSource Log;

		internal static readonly Harmony Harmony = new Harmony("GeeEM.WrestlingEmpire.WEFreeCamera");

		internal static string PluginPath;

		internal static bool inFreeCamMode = false;

		internal static bool cameraLocked = false;

		internal static Camera ourCamera;

		internal static Camera currentMain;

		internal static Camera CAC = null;

		public static GameObject trackingAction = null;

		internal static List<MonoBehaviour> CACBehaviours = new List<MonoBehaviour>();

		internal static Vector3? currentUserCameraPosition;

		internal static Quaternion? currentUserCameraRotation;

		public static ConfigEntry<double> configCameraMoveSpeed;

		internal static Vector3 previousMousePosition;

		internal static CustomCamera freeCamScript;

		public static List<string> movementModes = new List<string> { "Relative", "Static" };

		public static int currentMode = 0;

		public static ConfigEntry<KeyCode> configToggle;

		public static ConfigEntry<KeyCode> configLock;

		public static ConfigEntry<KeyCode> configSpeed;

		public static ConfigEntry<KeyCode> configMode;

		public static ConfigEntry<KeyCode> configLeft;

		public static ConfigEntry<KeyCode> configRight;

		public static ConfigEntry<KeyCode> configForwards;

		public static ConfigEntry<KeyCode> configBackwards;

		public static ConfigEntry<KeyCode> configUp;

		public static ConfigEntry<KeyCode> configDown;

		public static ConfigEntry<KeyCode> configTargeting;

		public static ConfigEntry<KeyCode> configIncreaseFoV;

		public static ConfigEntry<KeyCode> configDecreaseFoV;

		public static ConfigEntry<Vector3>[] savedPositions = new ConfigEntry<Vector3>[10];

		public static ConfigEntry<Quaternion>[] savedRotations = new ConfigEntry<Quaternion>[10];

		public static ConfigEntry<float>[] savedFoVs = new ConfigEntry<float>[10];

		private void Awake()
		{
			Log = ((BaseUnityPlugin)this).Logger;
			PluginPath = Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location);
			configCameraMoveSpeed = ((BaseUnityPlugin)this).Config.Bind<double>("Camera", "CameraSpeed", 10.0, "Camera move speed");
			configToggle = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Controls", "CameraToggle", (KeyCode)111, "Toggle the free camera on and off");
			configLock = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Controls", "CameraLock", (KeyCode)108, "Lock the free camera in place");
			configSpeed = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Controls", "SuperSpeed", (KeyCode)303, "Super speed");
			configMode = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Controls", "MovementMode", (KeyCode)105, "Toggle between camera movement modes");
			configLeft = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Controls", "MoveLeft", (KeyCode)276, "Move left");
			configRight = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Controls", "MoveRight", (KeyCode)275, "Move Right");
			configForwards = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Controls", "MoveForwards", (KeyCode)273, "Move forwards");
			configBackwards = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Controls", "MoveBackwards", (KeyCode)274, "Move backwards");
			configUp = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Controls", "MoveUp", (KeyCode)32, "Move up");
			configDown = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Controls", "MoveDown", (KeyCode)306, "Move down");
			configTargeting = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Controls", "TargetingMode", (KeyCode)113, "Sets the camera to target the game action. May not work if the main game camera is set to first person");
			configIncreaseFoV = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Controls", "IncreaseFoV", (KeyCode)91, "Increases the free camera field of view");
			configDecreaseFoV = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Controls", "DecreaseFoV", (KeyCode)93, "Decreases the free camera field of view");
			SetPositions();
			((BaseUnityPlugin)this).Config.SaveOnConfigSet = true;
		}

		private void SetPositions()
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: 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_0075: Unknown result type (might be due to invalid IL or missing references)
			for (int i = 0; i < 10; i++)
			{
				savedPositions[i] = ((BaseUnityPlugin)this).Config.Bind<Vector3>("Positions", "Position" + i, default(Vector3), "Position " + i);
				savedRotations[i] = ((BaseUnityPlugin)this).Config.Bind<Quaternion>("Positions", "Rotation" + i, default(Quaternion), "Rotation " + i);
				savedFoVs[i] = ((BaseUnityPlugin)this).Config.Bind<float>("Positions", "FoV" + i, 50f, "FoV " + i);
			}
		}

		public static void SavePosition(int num, Vector3 pos, Quaternion rot, float fov)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			savedPositions[num].Value = pos;
			savedRotations[num].Value = rot;
			savedFoVs[num].Value = fov;
		}

		public static void LoadPosition(int num, out Vector3 pos, out Quaternion rot, out float fov)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			pos = savedPositions[num].Value;
			rot = savedRotations[num].Value;
			fov = savedFoVs[num].Value;
		}

		private void OnEnable()
		{
			Harmony.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Loaded WEFreeCamera!");
		}

		private void OnDisable()
		{
			Harmony.UnpatchSelf();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Unloaded WEFreeCamera!");
		}

		internal void BeginFreecam()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			inFreeCamMode = true;
			previousMousePosition = Input.mousePosition;
			CacheMainCamera();
			SetupFreeCamera();
		}

		private static void CacheMainCamera()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			currentMain = Camera.main;
			if (Object.op_Implicit((Object)(object)currentMain) && !currentUserCameraPosition.HasValue)
			{
				currentUserCameraPosition = ((Component)currentMain).transform.position;
				currentUserCameraRotation = ((Component)currentMain).transform.rotation;
			}
		}

		private void SetupFreeCamera()
		{
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0194: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)ourCamera))
			{
				GameObject val = GameObject.Find("CustomArenaCamera");
				if (!Object.op_Implicit((Object)(object)val))
				{
					ourCamera = Object.Instantiate<Camera>(currentMain);
					((Object)ourCamera).name = "Freecam";
					((Component)ourCamera).gameObject.tag = "MainCamera";
					Object.DontDestroyOnLoad((Object)(object)((Component)ourCamera).gameObject);
					((Object)((Component)ourCamera).gameObject).hideFlags = (HideFlags)61;
				}
				else
				{
					((Object)val).name = "CAC";
					CAC = val.GetComponent<Camera>();
					ourCamera = Object.Instantiate<Camera>(CAC);
					((Object)((Component)ourCamera).gameObject).name = "Freecam";
					MonoBehaviour[] components = ((Component)CAC).GetComponents<MonoBehaviour>();
					foreach (MonoBehaviour val2 in components)
					{
						if (((Behaviour)val2).enabled)
						{
							CACBehaviours.Add(val2);
							((Behaviour)val2).enabled = false;
						}
						((Behaviour)CAC).enabled = false;
					}
					Object.DontDestroyOnLoad((Object)(object)((Component)ourCamera).gameObject);
					((Object)((Component)ourCamera).gameObject).hideFlags = (HideFlags)61;
				}
			}
			if (!Object.op_Implicit((Object)(object)freeCamScript))
			{
				freeCamScript = ((Component)ourCamera).gameObject.AddComponent<CustomCamera>();
			}
			((Component)ourCamera).transform.position = currentUserCameraPosition.Value;
			((Component)ourCamera).transform.rotation = currentUserCameraRotation.Value;
			((Component)ourCamera).gameObject.SetActive(true);
			((Behaviour)ourCamera).enabled = true;
			((Behaviour)((Component)currentMain).GetComponent<AudioListener>()).enabled = false;
			((Behaviour)((Component)currentMain).GetComponent<Camera>()).enabled = false;
		}

		internal static void EndFreecam()
		{
			inFreeCamMode = false;
			trackingAction = null;
			if (Object.op_Implicit((Object)(object)ourCamera))
			{
				Object.Destroy((Object)(object)((Component)ourCamera).gameObject);
				ourCamera = null;
			}
			if (Object.op_Implicit((Object)(object)freeCamScript))
			{
				Object.Destroy((Object)(object)freeCamScript);
				freeCamScript = null;
			}
			if (Object.op_Implicit((Object)(object)CAC))
			{
				((Object)((Component)CAC).gameObject).name = "CustomArenaCamera";
				((Behaviour)CAC).enabled = true;
				foreach (MonoBehaviour cACBehaviour in CACBehaviours)
				{
					((Behaviour)cACBehaviour).enabled = true;
				}
			}
			CACBehaviours.Clear();
			if (Object.op_Implicit((Object)(object)currentMain))
			{
				((Behaviour)((Component)currentMain).GetComponent<AudioListener>()).enabled = true;
				((Behaviour)((Component)currentMain).GetComponent<Camera>()).enabled = true;
			}
		}

		private void Update()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			if (Input.GetKeyDown(configMode.Value))
			{
				currentMode++;
				if (currentMode == movementModes.Count)
				{
					currentMode = 0;
				}
			}
			if (Input.GetKeyDown(configTargeting.Value))
			{
				if (!Object.op_Implicit((Object)(object)trackingAction))
				{
					trackingAction = GameObject.Find("Camera Focal Point");
				}
				else
				{
					trackingAction = null;
				}
			}
			if (Input.GetKeyDown(configToggle.Value) && !inFreeCamMode)
			{
				BeginFreecam();
			}
			else if (Input.GetKeyDown(configToggle.Value) && inFreeCamMode)
			{
				EndFreecam();
			}
		}
	}
	[HarmonyPatch(typeof(LIPNHOMGGHF))]
	public static class LIPNHOMGGHF_Patch
	{
		[HarmonyPrefix]
		[HarmonyPatch("PMIIOCMHEAE")]
		public static void Prefix()
		{
			if (FreeCameraPlugin.inFreeCamMode)
			{
				FreeCameraPlugin.EndFreecam();
			}
		}
	}
	[HarmonyPatch(typeof(BJMGCKGNCHO), "IOKJAPIEGLB")]
	public static class BJMGCKGNCHO_Patch
	{
		[HarmonyPrefix]
		public static bool Prefix(BJMGCKGNCHO __instance, ref float __result)
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			if (!FreeCameraPlugin.inFreeCamMode)
			{
				return true;
			}
			__result = ((Component)FreeCameraPlugin.ourCamera).transform.eulerAngles.y + Mathf.Atan2(__instance.IMBKMMOCBBF, __instance.PNLIFOBMMGG) * 57.29578f;
			return false;
		}
	}
	[HarmonyPatch(typeof(Scene_Match_Setup), "AdjustCamera")]
	public static class Scene_Match_Setup_Patch
	{
		[HarmonyPostfix]
		public static void Postfix()
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			if (FreeCameraPlugin.inFreeCamMode)
			{
				((Component)FreeCameraPlugin.ourCamera).transform.position = FreeCameraPlugin.currentUserCameraPosition.Value;
				((Component)FreeCameraPlugin.ourCamera).transform.rotation = FreeCameraPlugin.currentUserCameraRotation.Value;
			}
		}
	}
	public class CustomCamera : MonoBehaviour
	{
		public Camera camera;

		private void Start()
		{
			camera = ((Component)this).GetComponent<Camera>();
		}

		internal void Update()
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: 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_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: 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)
			//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
			if (!FreeCameraPlugin.inFreeCamMode)
			{
				return;
			}
			HandlePositionSaveLoad();
			if (Input.GetKey(FreeCameraPlugin.configIncreaseFoV.Value))
			{
				Camera obj = camera;
				obj.fieldOfView += 0.5f;
			}
			if (Input.GetKey(FreeCameraPlugin.configDecreaseFoV.Value))
			{
				Camera obj2 = camera;
				obj2.fieldOfView -= 0.5f;
			}
			if (Input.GetKeyDown(FreeCameraPlugin.configLock.Value))
			{
				FreeCameraPlugin.cameraLocked = !FreeCameraPlugin.cameraLocked;
			}
			if (Object.op_Implicit((Object)(object)FreeCameraPlugin.trackingAction))
			{
				((Component)this).transform.LookAt(FreeCameraPlugin.trackingAction.transform);
			}
			if (FreeCameraPlugin.cameraLocked)
			{
				return;
			}
			float num = (float)FreeCameraPlugin.configCameraMoveSpeed.Value * Time.deltaTime;
			if (Input.GetKey(FreeCameraPlugin.configSpeed.Value))
			{
				num *= 10f;
			}
			string text = FreeCameraPlugin.movementModes[FreeCameraPlugin.currentMode];
			string text2 = text;
			if (!(text2 == "Relative"))
			{
				if (text2 == "Static")
				{
					HandleMovementModeStatic(num);
				}
			}
			else
			{
				HandleMovementModeRelative(num);
			}
			FreeCameraPlugin.currentUserCameraPosition = ((Component)this).transform.position;
			if (Input.GetMouseButton(1))
			{
				Vector3 val = Input.mousePosition - FreeCameraPlugin.previousMousePosition;
				float num2 = ((Component)this).transform.localEulerAngles.y + val.x * 0.3f;
				float num3 = ((Component)this).transform.localEulerAngles.x - val.y * 0.3f;
				((Component)this).transform.localEulerAngles = new Vector3(num3, num2, 0f);
				FreeCameraPlugin.currentUserCameraRotation = ((Component)this).transform.rotation;
			}
			FreeCameraPlugin.previousMousePosition = Input.mousePosition;
		}

		private void HandleMovementModeStatic(float moveSpeed)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: 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)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: 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_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: 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_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: 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_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_0145: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a3: 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_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01de: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
			if (Input.GetKey(FreeCameraPlugin.configLeft.Value))
			{
				Transform transform = ((Component)this).transform;
				transform.position += ((Component)this).transform.right * -1f * moveSpeed;
			}
			if (Input.GetKey(FreeCameraPlugin.configRight.Value))
			{
				Transform transform2 = ((Component)this).transform;
				transform2.position += ((Component)this).transform.right * moveSpeed;
			}
			if (Input.GetKey(FreeCameraPlugin.configForwards.Value))
			{
				Transform transform3 = ((Component)this).transform;
				transform3.position += Vector3.Normalize(new Vector3(((Component)this).transform.forward.x, 0f, ((Component)this).transform.forward.z)) * moveSpeed;
			}
			if (Input.GetKey(FreeCameraPlugin.configBackwards.Value))
			{
				Transform transform4 = ((Component)this).transform;
				transform4.position += Vector3.Normalize(new Vector3(((Component)this).transform.forward.x, 0f, ((Component)this).transform.forward.z)) * -1f * moveSpeed;
			}
			if (Input.GetKey(FreeCameraPlugin.configUp.Value))
			{
				Transform transform5 = ((Component)this).transform;
				transform5.position += Vector3.Normalize(new Vector3(0f, 1f, 0f)) * moveSpeed;
			}
			if (Input.GetKey(FreeCameraPlugin.configDown.Value))
			{
				Transform transform6 = ((Component)this).transform;
				transform6.position += Vector3.Normalize(new Vector3(0f, 1f, 0f)) * -1f * moveSpeed;
			}
		}

		private void HandleMovementModeRelative(float moveSpeed)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: 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)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: 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_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: 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_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: Unknown result type (might be due to invalid IL or missing references)
			if (Input.GetKey(FreeCameraPlugin.configLeft.Value))
			{
				Transform transform = ((Component)this).transform;
				transform.position += ((Component)this).transform.right * -1f * moveSpeed;
			}
			if (Input.GetKey(FreeCameraPlugin.configRight.Value))
			{
				Transform transform2 = ((Component)this).transform;
				transform2.position += ((Component)this).transform.right * moveSpeed;
			}
			if (Input.GetKey(FreeCameraPlugin.configForwards.Value))
			{
				Transform transform3 = ((Component)this).transform;
				transform3.position += ((Component)this).transform.forward * moveSpeed;
			}
			if (Input.GetKey(FreeCameraPlugin.configBackwards.Value))
			{
				Transform transform4 = ((Component)this).transform;
				transform4.position += ((Component)this).transform.forward * -1f * moveSpeed;
			}
			if (Input.GetKey(FreeCameraPlugin.configUp.Value))
			{
				Transform transform5 = ((Component)this).transform;
				transform5.position += ((Component)this).transform.up * moveSpeed;
			}
			if (Input.GetKey(FreeCameraPlugin.configDown.Value))
			{
				Transform transform6 = ((Component)this).transform;
				transform6.position += ((Component)this).transform.up * -1f * moveSpeed;
			}
		}

		private void HandlePositionSaveLoad()
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: 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_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			for (int i = 0; i < 10; i++)
			{
				KeyCode val = (KeyCode)Enum.Parse(typeof(KeyCode), "Alpha" + i);
				if (Input.GetKey(val) && Input.GetKey((KeyCode)96))
				{
					FreeCameraPlugin.SavePosition(i, ((Component)this).transform.position, ((Component)this).transform.rotation, camera.fieldOfView);
				}
				else if (Input.GetKey(val))
				{
					FreeCameraPlugin.LoadPosition(i, out var pos, out var rot, out var fov);
					((Component)this).transform.position = pos;
					((Component)this).transform.rotation = rot;
					camera.fieldOfView = fov;
					FreeCameraPlugin.currentUserCameraPosition = ((Component)this).transform.position;
					FreeCameraPlugin.currentUserCameraRotation = ((Component)this).transform.rotation;
				}
			}
		}
	}
}