Decompiled source of ScriptedLIVCam v0.0.1

Mods/ScriptedLIVCam.dll

Decompiled 2 weeks 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.Versioning;
using Il2CppExitGames.Client.Photon;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppLIV.SDK.Unity;
using Il2CppPhoton.Pun;
using Il2CppPhoton.Realtime;
using Il2CppRUMBLE.Interactions.InteractionBase;
using Il2CppRUMBLE.Managers;
using Il2CppRUMBLE.Players;
using Il2CppRUMBLE.Utilities;
using Il2CppSystem;
using Il2CppSystem.Collections.Generic;
using Il2CppTMPro;
using MelonLoader;
using Microsoft.CodeAnalysis;
using Newtonsoft.Json;
using RumbleModUI;
using RumbleModdingAPI;
using ScriptedLIVCam;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(ScriptedLCMain), "ScriptedLIVCam", "1.0.0", "TacoSlayer36", null)]
[assembly: MelonGame("Buckethead Entertainment", "RUMBLE")]
[assembly: MelonColor(255, 255, 248, 231)]
[assembly: MelonAuthorColor(255, 255, 248, 231)]
[assembly: VerifyLoaderVersion(0, 6, 6, true)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("ScriptedLIVCam")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+953fcbbb9eb27d938b56fa359934fa3d077b2941")]
[assembly: AssemblyProduct("ScriptedLIVCam")]
[assembly: AssemblyTitle("ScriptedLIVCam")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace ScriptedLIVCam
{
	public static class BuildInfo
	{
		public const string ModName = "ScriptedLIVCam";

		public const string ModVersion = "1.0.0";

		public const string Description = "Make the LIV camera follow custom paths";

		public const string Author = "TacoSlayer36";

		public const string Company = "";
	}
	public class ScriptedLCMain : MelonMod
	{
		private enum Tool
		{
			Select,
			Pen,
			Anchor,
			SelectMarker,
			AddPauseMarker,
			AddRollMarker,
			AddFOVMarker,
			AddSpeedMarker,
			DeleteMarker,
			MoveStatic,
			GrabStatic
		}

		[CompilerGenerated]
		private sealed class <listenForFlatLandButton>d__168 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public ScriptedLCMain <>4__this;

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

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

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

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0026: Unknown result type (might be due to invalid IL or missing references)
				//IL_0030: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = (object)new WaitForSeconds(1f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					GameObject.Find("FlatLand/FlatLandButton/Button").GetComponent<InteractionButton>().onPressed.AddListener(UnityAction.op_Implicit((Action)delegate
					{
						MelonCoroutines.Start(<>4__this.toFlatLand());
					}));
					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();
			}
		}

		[CompilerGenerated]
		private sealed class <setUpAudioListeners>d__178 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public ScriptedLCMain <>4__this;

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

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

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

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0026: Unknown result type (might be due to invalid IL or missing references)
				//IL_0030: Expected O, but got Unknown
				//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = (object)new WaitForSeconds(2f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					<>4__this.playerAudioListener = ((Component)((Component)Managers.GetPlayerManager().LocalPlayer.Controller).transform.GetChild(1).GetChild(0).GetChild(0)).GetComponent<AudioListener>();
					<>4__this.camAudioListener = <>4__this.livCameraIndicator.AddComponent<AudioListener>();
					((Behaviour)<>4__this.camAudioListener).enabled = false;
					((Component)<>4__this.camAudioListener).tag = "ScriptedLIVCam";
					<>4__this.camAudioListener.velocityUpdateMode = <>4__this.playerAudioListener.velocityUpdateMode;
					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();
			}
		}

		[CompilerGenerated]
		private sealed class <toFlatLand>d__169 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public ScriptedLCMain <>4__this;

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

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

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

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0026: Unknown result type (might be due to invalid IL or missing references)
				//IL_0030: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = (object)new WaitForSeconds(1f);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					<>4__this.modParentObject.active = true;
					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();
			}
		}

		private Mod Mod = new Mod();

		private bool hasFlatLand = false;

		public GameObject? CurvesParent;

		public List<Curve> Curves = new List<Curve>();

		private List<Curve> curvesToSave = new List<Curve>();

		private Curve? currentCurve;

		private Curve? storedSelectedCurve;

		public GameObject livObject;

		private List<CurveFile> undoStates = new List<CurveFile>();

		private int statesUndone = 0;

		private int maxUndoStates = 10;

		private bool isStateChanging = false;

		private bool isUndoRedoOperation = false;

		private string directoryPath = "UserData/ScriptedLIVCam/SavedSplines";

		private string otherSettingsPath = "UserData/ScriptedLIVCam/OtherSettings.txt";

		public int dontShowOnLIVLayer = LayerMask.NameToLayer("PlayerController");

		private GameObject? modParentObject;

		private string scene = string.Empty;

		private const byte eventNumber = 32;

		private static RaiseEventOptions eventOptions = new RaiseEventOptions
		{
			Receivers = (ReceiverGroup)1
		};

		private bool init = false;

		private bool curveEditingEnabled = true;

		private bool isMinimized = false;

		public bool currentTriggerState;

		public bool previousTriggerState;

		public bool currentGripState = false;

		public bool previousGripState = false;

		public bool currentMainPrimaryState = false;

		public bool currentMainSecondaryState = false;

		public bool currentOffPrimaryState = false;

		private List<KeyCode> playKeyCodes = new List<KeyCode>();

		private List<KeyCode> stopKeyCodes = new List<KeyCode>();

		private bool settingPlayKey = false;

		private bool settingStopKey = false;

		private float triggerThreshold = 0.2f;

		private float gripThreshold = 0.5f;

		private float dragThreshold = 0.06f;

		private float pointGripRadius = 0.12f;

		public string EmptyField = "---";

		private ControlPoint? activeRawPoint;

		private SelectedControl? selectedControl;

		public MarkerPoint? ActiveRawMarker;

		public MarkerPoint? SelectedMarker;

		private List<MarkerPoint> passedPauseMarkers = new List<MarkerPoint>();

		public float cameraRoll = 0f;

		public float cameraSpeed = 0f;

		public float cameraFOV = 0f;

		public float staticFOV = 60f;

		public float staticRoll = 0f;

		private GameObject? markerPreview;

		private Transform rightHandTransform = new Transform();

		private Transform leftHandTransform = new Transform();

		private Transform mainHandTransform = new Transform();

		private Transform offHandTransform = new Transform();

		private Vector3 prevMainHandPos = default(Vector3);

		private Quaternion prevMainHandRot = default(Quaternion);

		private bool swapMainHand = false;

		private bool snapPosition = false;

		private bool snapRotation = false;

		private bool cameraAudio = false;

		private bool hideTags = false;

		private float snapRange = 0.1f;

		private bool editingCurve = false;

		private bool useLegacyCam = false;

		private GameObject? localHealthBar;

		public Material? curveMaterial;

		private GameObject? scLCBlueprints;

		private GameObject? scriptMenuBlueprint;

		private GameObject? cameraBlueprint;

		private Material dofMaterial;

		private float focusDistance = 10f;

		private float blurStrength = 1f;

		public GameObject? pauseMarkerBlueprint;

		public GameObject? rollMarkerBlueprint;

		public GameObject? fovMarkerBlueprint;

		public GameObject? speedMarkerBlueprint;

		private GameObject? scriptMenu;

		private GameObject? livCameraIndicator;

		private GameObject? RotTargetObject;

		private GameObject? FocusTargetObject;

		private GameObject? Maximized;

		private GameObject? Minimized;

		private GameObject? UISelectMenu;

		private GameObject? UIEditMenu;

		private GameObject? UIMarkersMenu;

		private GameObject? UIStaticMenu;

		private GameObject? UINetworkMenu;

		private GameObject? UIFileMenu;

		private GameObject? UISettingsMenu;

		private List<Image> UIImageComponents = new List<Image>();

		private List<GameObject> UISelectedIDTexts = new List<GameObject>();

		private GameObject UISelectedOwnerText;

		private GameObject? UISelectedRotTarget;

		private GameObject? UISelectedFocusTarget;

		private GameObject? UICurveDuration;

		private GameObject? UICurveDurationPauses;

		private GameObject? UIOrderPosText;

		private bool modifyingCurveDuration = false;

		private GameObject? UIIsHidden;

		private GameObject? UIIsEnabled;

		private GameObject? UIIsLoop;

		private GameObject? UIIsStatic;

		private List<GameObject?> UIToolButtons = new List<GameObject>();

		private GameObject? UIMoveCurveTool;

		private GameObject? UIPenTool;

		private GameObject? UIPenTool2;

		private GameObject? UIAnchorTool;

		private GameObject? UISelectMarkerTool;

		private GameObject? UIPauseMarkerTool;

		private GameObject? UIRollMarkerTool;

		private GameObject? UIDeleteMarkerTool;

		private GameObject? UIFovMarkerTool;

		private GameObject? UISpeedMarkerTool;

		private GameObject? UIMoveStaticTool;

		private GameObject? UIGrabTool;

		private GameObject? UISelectMarkerTool2;

		private GameObject? UIStaticFOV;

		private bool modifyingStaticFOV = false;

		private GameObject? UIStaticRoll;

		private bool modifyingStaticRoll = false;

		private List<GameObject> UIfileOptions = new List<GameObject>();

		private List<string> fileNames = new List<string>();

		private int selectedFileOption = 0;

		private int filePage = 0;

		private GameObject? UILoadInGym;

		private GameObject? UILoadInPark;

		private GameObject? UILoadInRing;

		private GameObject? UILoadInPit;

		private List<string> loadInGym = new List<string>();

		private List<string> loadInPark = new List<string>();

		private List<string> loadInRing = new List<string>();

		private List<string> loadInPit = new List<string>();

		private GameObject? UIRequestIDText;

		private GameObject? UIRequestOwnerText;

		private CurveFile curveSendRequest;

		private GameObject? UISwapHandsText;

		private GameObject? UISnapPosText;

		private GameObject? UISnapRotText;

		private GameObject? UICameraAudioText;

		private GameObject? UIHideTagsText;

		private Tool selectedTool = Tool.Pen;

		private List<Tool> addMarkerTools = new List<Tool>
		{
			Tool.AddPauseMarker,
			Tool.AddRollMarker,
			Tool.AddFOVMarker,
			Tool.AddSpeedMarker
		};

		private SlideValue? slidingValue;

		private LIV liv;

		private bool isPointingAtCanvas = false;

		private GameObject? uiPointer;

		private bool isCameraAnimating = false;

		private bool isPlayingAll = false;

		private bool isCameraPaused = false;

		private float cameraLineOffset = 0f;

		private bool isCameraStatic = false;

		private Vector3 staticCameraPos = Vector3.zero;

		private Quaternion staticCameraRot = Quaternion.identity;

		private float staticCameraFOV = 60f;

		private float staticCameraRoll = 0f;

		private AudioListener playerAudioListener;

		private AudioListener camAudioListener;

		private RecordingCamera legacyCamRC;

		private AudioListener legacyCamAudioListener;

		private GameObject legacyCam;

		public static ScriptedLCMain Instance { get; set; } = new ScriptedLCMain();


		public override void OnLateInitializeMelon()
		{
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Expected O, but got Unknown
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			UI.instance.UI_Initialized += OnUIInit;
			Calls.onMapInitialized += SceneLoaded;
			Calls.onMyModsGathered += checkMods;
			Calls.onPlayerSpawned += playerJoined;
			Instance = this;
			curveMaterial = new Material(Shader.Find("Universal Render Pipeline/Unlit"));
			curveMaterial.color = Color.white;
			((Object)curveMaterial).hideFlags = (HideFlags)61;
		}

		private void checkMods()
		{
			hasFlatLand = Mods.findOwnMod("FlatLand", "1.6.0", false);
		}

		public void playerJoined()
		{
			setTagsVisibility(!hideTags);
		}

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

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

		public void OnUIInit()
		{
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Expected O, but got Unknown
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Expected O, but got Unknown
			Mod.ModName = "ScriptedLIVCam";
			Mod.ModVersion = "1.0.0";
			Mod.SetFolder("ScriptedLivCam");
			Mod.AddDescription("Description", "", "Make the LIV camera follow custom paths", new Tags
			{
				IsSummary = true
			});
			Mod.AddToList("Spline Editing", false, 0, "Set to enable the menu and all spline editing", new Tags());
			Mod.GetFromFile();
			Mod.ModSaved += Save;
			Save();
			UI.instance.AddMod(Mod);
		}

		private void closeMenu()
		{
			if ((Object)(object)scriptMenu != (Object)null)
			{
				scriptMenu.SetActive(false);
			}
			if ((Object)(object)uiPointer != (Object)null)
			{
				uiPointer.SetActive(false);
			}
		}

		private void SaveOtherSettings()
		{
			var anon = new
			{
				LoadInGym = loadInGym,
				LoadInPark = loadInPark,
				LoadInRing = loadInRing,
				LoadInPit = loadInPit
			};
			string contents = JsonConvert.SerializeObject((object)anon, (Formatting)1);
			File.WriteAllText(otherSettingsPath, contents);
		}

		private void LoadOtherSettings()
		{
			if (!File.Exists(otherSettingsPath))
			{
				SaveOtherSettings();
			}
			string text = File.ReadAllText(otherSettingsPath);
			dynamic val = JsonConvert.DeserializeObject<object>(text);
			loadInGym = ((IEnumerable<string>)val.LoadInGym.ToObject<List<string>>()).Where((string file) => File.Exists(Path.Combine(directoryPath, file))).ToList();
			loadInPark = ((IEnumerable<string>)val.LoadInPark.ToObject<List<string>>()).Where((string file) => File.Exists(Path.Combine(directoryPath, file))).ToList();
			loadInRing = ((IEnumerable<string>)val.LoadInRing.ToObject<List<string>>()).Where((string file) => File.Exists(Path.Combine(directoryPath, file))).ToList();
			loadInPit = ((IEnumerable<string>)val.LoadInPit.ToObject<List<string>>()).Where((string file) => File.Exists(Path.Combine(directoryPath, file))).ToList();
			SaveOtherSettings();
		}

		public void Save()
		{
			curveEditingEnabled = (bool)Mod.Settings[1].SavedValue;
			if (curveEditingEnabled && (Object)(object)scriptMenu != (Object)null)
			{
				scriptMenu.SetActive(true);
			}
			else
			{
				closeMenu();
			}
		}

		public override void OnSceneWasUnloaded(int buildIndex, string sceneName)
		{
			if (!(sceneName == "Loader") && !(sceneName == string.Empty))
			{
				Curves.Clear();
				currentCurve = null;
				stopAnimation();
			}
		}

		public override void OnSceneWasLoaded(int buildIndex, string sceneName)
		{
			scene = sceneName;
		}

		public void SceneLoaded()
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Expected O, but got Unknown
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Expected O, but got Unknown
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Expected O, but got Unknown
			if (!init && scene == "Gym")
			{
				if ((Object)(object)livObject == (Object)null)
				{
					livObject = new GameObject("LIV");
					liv = livObject.AddComponent<LIV>();
					Object.DontDestroyOnLoad((Object)(object)livObject);
				}
				instantiateBlueprints();
				LoadBalancingClient networkingClient = PhotonNetwork.NetworkingClient;
				networkingClient.EventReceived += Action<EventData>.op_Implicit((Action<EventData>)OnEvent);
				init = true;
			}
			if (hasFlatLand && scene == "Gym")
			{
				MelonCoroutines.Start(listenForFlatLandButton());
			}
			if (scene == "Loader")
			{
				return;
			}
			localHealthBar = Players.GetLocalHealthbarGameObject();
			setTagsVisibility(!hideTags);
			if ((Object)(object)modParentObject == (Object)null)
			{
				modParentObject = new GameObject("ScriptedLIVCam");
			}
			if ((Object)(object)modParentObject != (Object)null)
			{
				if ((Object)(object)CurvesParent == (Object)null)
				{
					CurvesParent = new GameObject("CurvesParent");
					CurvesParent.transform.SetParent(modParentObject.transform, true);
				}
				if ((Object)(object)livCameraIndicator == (Object)null)
				{
					livCameraIndicator = Object.Instantiate<GameObject>(cameraBlueprint);
					livCameraIndicator.transform.SetParent(modParentObject.transform, true);
					livCameraIndicator.SetActive(false);
					((Component)livCameraIndicator.transform.GetChild(0)).gameObject.layer = dontShowOnLIVLayer;
				}
				if ((Object)(object)livCameraIndicator != (Object)null)
				{
					MelonCoroutines.Start(setUpAudioListeners());
				}
				if ((Object)(object)scriptMenu == (Object)null)
				{
					scriptMenu = Object.Instantiate<GameObject>(scriptMenuBlueprint);
					if ((Object)(object)scriptMenu != (Object)null)
					{
						((Object)scriptMenu).name = "ScriptMenu";
						scriptMenu.transform.SetParent(modParentObject.transform, true);
						((Component)scriptMenu.transform.GetChild(0)).gameObject.layer = dontShowOnLIVLayer;
						scriptMenu.SetActive(curveEditingEnabled);
						Maximized = ((Component)scriptMenu.transform.GetChild(0).GetChild(0)).gameObject;
						Minimized = ((Component)scriptMenu.transform.GetChild(0).GetChild(1)).gameObject;
						UISelectMenu = ((Component)Maximized.transform.GetChild(3)).gameObject;
						UIEditMenu = ((Component)Maximized.transform.GetChild(4)).gameObject;
						UIMarkersMenu = ((Component)Maximized.transform.GetChild(5)).gameObject;
						UIStaticMenu = ((Component)Maximized.transform.GetChild(6)).gameObject;
						UINetworkMenu = ((Component)Maximized.transform.GetChild(7)).gameObject;
						UIFileMenu = ((Component)Maximized.transform.GetChild(8)).gameObject;
						UISettingsMenu = ((Component)Maximized.transform.GetChild(9)).gameObject;
						UISelectedIDTexts.Clear();
						UISelectedIDTexts.Add(((Component)UISelectMenu.transform.GetChild(3).GetChild(2)).gameObject);
						UISelectedIDTexts.Add(((Component)UIEditMenu.transform.GetChild(1).GetChild(0)).gameObject);
						UISelectedIDTexts.Add(((Component)UIMarkersMenu.transform.GetChild(0).GetChild(0)).gameObject);
						UISelectedIDTexts.Add(((Component)UINetworkMenu.transform.GetChild(1).GetChild(0)).gameObject);
						UIImageComponents.Clear();
						UIImageComponents.AddRange((IEnumerable<Image>)((Component)scriptMenu.transform).GetComponentsInChildren<Image>());
						UISelectedOwnerText = ((Component)UINetworkMenu.transform.GetChild(1).GetChild(1)).gameObject;
						UIIsEnabled = ((Component)UISelectMenu.transform.GetChild(1).GetChild(0).GetChild(0)
							.GetChild(0)
							.GetChild(0)
							.GetChild(1)
							.GetChild(0)).gameObject;
						UIIsHidden = ((Component)UISelectMenu.transform.GetChild(1).GetChild(0).GetChild(0)
							.GetChild(1)
							.GetChild(0)
							.GetChild(1)
							.GetChild(0)).gameObject;
						UIIsLoop = ((Component)UIMarkersMenu.transform.GetChild(7).GetChild(0).GetChild(1)
							.GetChild(0)).gameObject;
						UIIsStatic = ((Component)UIStaticMenu.transform.GetChild(0).GetChild(0).GetChild(1)).gameObject;
						UISelectedRotTarget = ((Component)UIMarkersMenu.transform.GetChild(6).GetChild(2)).gameObject;
						UICurveDuration = ((Component)UIMarkersMenu.transform.GetChild(4).GetChild(1).GetChild(0)).gameObject;
						UICurveDurationPauses = ((Component)UIMarkersMenu.transform.GetChild(4).GetChild(4)).gameObject;
						UIOrderPosText = ((Component)UIEditMenu.transform.GetChild(3).GetChild(0).GetChild(0)).gameObject;
						UIToolButtons.Clear();
						UIToolButtons.Add(UIMoveCurveTool = ((Component)UIEditMenu.transform.GetChild(0).GetChild(0)).gameObject);
						UIToolButtons.Add(UIPenTool = ((Component)UIEditMenu.transform.GetChild(0).GetChild(1)).gameObject);
						UIToolButtons.Add(UIPenTool2 = ((Component)Maximized.transform.GetChild(10).GetChild(1)).gameObject);
						UIToolButtons.Add(UIAnchorTool = ((Component)UIEditMenu.transform.GetChild(0).GetChild(2)).gameObject);
						UIToolButtons.Add(UISelectMarkerTool = ((Component)UIMarkersMenu.transform.GetChild(1).GetChild(0)).gameObject);
						UIToolButtons.Add(UIPauseMarkerTool = ((Component)UIMarkersMenu.transform.GetChild(1).GetChild(1)).gameObject);
						UIToolButtons.Add(UIRollMarkerTool = ((Component)UIMarkersMenu.transform.GetChild(1).GetChild(2)).gameObject);
						UIToolButtons.Add(UIDeleteMarkerTool = ((Component)UIMarkersMenu.transform.GetChild(2).GetChild(0)).gameObject);
						UIToolButtons.Add(UIFovMarkerTool = ((Component)UIMarkersMenu.transform.GetChild(2).GetChild(1)).gameObject);
						UIToolButtons.Add(UISpeedMarkerTool = ((Component)UIMarkersMenu.transform.GetChild(2).GetChild(2)).gameObject);
						UIToolButtons.Add(UIMoveStaticTool = ((Component)UIStaticMenu.transform.GetChild(3).GetChild(0)).gameObject);
						UIToolButtons.Add(UIGrabTool = ((Component)UIStaticMenu.transform.GetChild(3).GetChild(1)).gameObject);
						UIToolButtons.Add(UISelectMarkerTool2 = ((Component)Maximized.transform.GetChild(10).GetChild(2)).gameObject);
						UIStaticFOV = ((Component)UIStaticMenu.transform.GetChild(1).GetChild(1).GetChild(0)).gameObject;
						UIStaticRoll = ((Component)UIStaticMenu.transform.GetChild(2).GetChild(1).GetChild(0)).gameObject;
						UIfileOptions.Clear();
						for (int i = 0; i < 8; i++)
						{
							UIfileOptions.Add(((Component)UIFileMenu.transform.GetChild(2).GetChild(i)).gameObject);
						}
						UIRequestIDText = ((Component)UINetworkMenu.transform.GetChild(3).GetChild(0)).gameObject;
						UIRequestOwnerText = ((Component)UINetworkMenu.transform.GetChild(3).GetChild(1)).gameObject;
						UISwapHandsText = ((Component)UISettingsMenu.transform.GetChild(0).GetChild(0).GetChild(1)
							.GetChild(0)).gameObject;
						UISnapPosText = ((Component)UISettingsMenu.transform.GetChild(0).GetChild(0).GetChild(1)
							.GetChild(0)).gameObject;
						UISnapRotText = ((Component)UISettingsMenu.transform.GetChild(1).GetChild(0).GetChild(1)
							.GetChild(0)).gameObject;
						UICameraAudioText = ((Component)UISettingsMenu.transform.GetChild(10).GetChild(0).GetChild(1)
							.GetChild(0)).gameObject;
						UIHideTagsText = ((Component)UISettingsMenu.transform.GetChild(11).GetChild(0).GetChild(1)
							.GetChild(0)).gameObject;
						UILoadInGym = ((Component)UIFileMenu.transform.GetChild(5).GetChild(0)).gameObject;
						UILoadInPark = ((Component)UIFileMenu.transform.GetChild(5).GetChild(1)).gameObject;
						UILoadInRing = ((Component)UIFileMenu.transform.GetChild(5).GetChild(2)).gameObject;
						UILoadInPit = ((Component)UIFileMenu.transform.GetChild(5).GetChild(3)).gameObject;
						disableAllMenus();
						UISelectMenu.SetActive(true);
						if (isMinimized)
						{
							Maximized.SetActive(false);
							Minimized.SetActive(true);
						}
						RefreshFileList();
						UpdateFileUI();
					}
				}
			}
			stopStatic();
			string text = scene;
			if (1 == 0)
			{
			}
			List<string> list = text switch
			{
				"Gym" => loadInGym, 
				"Park" => loadInPark, 
				"Map0" => loadInRing, 
				"Map1" => loadInPit, 
				_ => new List<string>(), 
			};
			if (1 == 0)
			{
			}
			List<string> list2 = list;
			foreach (string item in list2)
			{
				string path = Path.Combine(directoryPath, item);
				if (File.Exists(path))
				{
					string text2 = File.ReadAllText(path);
					CurveFile curveFile = JsonConvert.DeserializeObject<CurveFile>(text2);
					appendCurves(curveFile);
				}
			}
		}

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

		public void OnEvent(EventData photonEvent)
		{
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Expected O, but got Unknown
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			if (photonEvent.Code != 32)
			{
				return;
			}
			string text = photonEvent.CustomData.ToString();
			char c = text[0];
			string id = text.Substring(1, 8);
			string text2 = text.Substring(9);
			if (c == 'R')
			{
				List<Curve> list = new List<Curve>();
				Curve curveByID = GetCurveByID(id);
				if (curveByID != null)
				{
					list.Add(curveByID);
					if (curveByID.RotTarget != null)
					{
						list.Add(curveByID.RotTarget);
					}
					CurveFile curveFile = new CurveFile
					{
						FileName = "",
						Owner = Managers.GetPlayerManager().LocalPlayer.Data.GeneralData.PlayFabMasterId,
						Curves = list
					};
					string text3 = JsonConvert.SerializeObject((object)curveFile, (Formatting)1, new JsonSerializerSettings
					{
						ReferenceLoopHandling = (ReferenceLoopHandling)1
					});
					PhotonNetwork.RaiseEvent((byte)32, Object.op_Implicit("U--------" + text3), eventOptions, SendOptions.SendReliable);
				}
				return;
			}
			CurveFile curveFile2 = JsonConvert.DeserializeObject<CurveFile>(text2);
			if (curveFile2 == null)
			{
				return;
			}
			if (c == 'N')
			{
				foreach (Curve curf in Curves)
				{
					if (curf.Id == curveFile2.Curves[0].Id)
					{
						overwriteCurves(curveFile2);
						return;
					}
				}
				curveSendRequest = curveFile2;
			}
			if (c == 'U')
			{
				overwriteCurves(curveFile2);
			}
			updateTexts();
		}

		private void instantiateBlueprints()
		{
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			scLCBlueprints = LoadAssetBundle("ScriptedLIVCam.assets.scriptedlivcam", "ScLCBlueprints");
			scriptMenuBlueprint = ((Component)scLCBlueprints.transform.GetChild(0)).gameObject;
			cameraBlueprint = ((Component)scLCBlueprints.transform.GetChild(1)).gameObject;
			rollMarkerBlueprint = ((Component)scLCBlueprints.transform.GetChild(2)).gameObject;
			fovMarkerBlueprint = ((Component)scLCBlueprints.transform.GetChild(3)).gameObject;
			pauseMarkerBlueprint = ((Component)scLCBlueprints.transform.GetChild(4)).gameObject;
			speedMarkerBlueprint = ((Component)scLCBlueprints.transform.GetChild(5)).gameObject;
			MeshRenderer component = ((Component)cameraBlueprint.transform.GetChild(0)).GetComponent<MeshRenderer>();
			((Renderer)component).material = curveMaterial;
			((Renderer)component).material.color = Color.green;
			Object.DontDestroyOnLoad((Object)(object)scLCBlueprints);
			scLCBlueprints.SetActive(false);
		}

		public override void OnUpdate()
		{
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: 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_00f0: 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_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: 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_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: 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_01f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0265: Unknown result type (might be due to invalid IL or missing references)
			//IL_026f: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b27: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b2c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b38: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b3d: 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_0340: Unknown result type (might be due to invalid IL or missing references)
			//IL_038e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0785: Unknown result type (might be due to invalid IL or missing references)
			//IL_07a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0402: Unknown result type (might be due to invalid IL or missing references)
			//IL_041c: Unknown result type (might be due to invalid IL or missing references)
			//IL_067c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0681: Unknown result type (might be due to invalid IL or missing references)
			//IL_0684: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_04aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_04af: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_04bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_04cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_045b: 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_047a: Unknown result type (might be due to invalid IL or missing references)
			//IL_06b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_06cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_086f: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_070a: Unknown result type (might be due to invalid IL or missing references)
			//IL_08d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a99: Unknown result type (might be due to invalid IL or missing references)
			if (init)
			{
				PlayerManager playerManager = Managers.GetPlayerManager();
				if ((Object)(object)playerManager != (Object)null && playerManager.LocalPlayer != null && (Object)(object)playerManager.LocalPlayer.Controller != (Object)null)
				{
					Transform transform = ((Component)playerManager.LocalPlayer.Controller).transform;
					if (transform.childCount > 1)
					{
						rightHandTransform = transform.GetChild(1).GetChild(2);
						leftHandTransform = transform.GetChild(1).GetChild(1);
						if ((Object)(object)rightHandTransform != (Object)null && (Object)(object)leftHandTransform != (Object)null)
						{
							mainHandTransform = rightHandTransform;
							offHandTransform = leftHandTransform;
						}
					}
				}
			}
			if (isCameraStatic)
			{
				Quaternion val = Quaternion.LookRotation(staticCameraRot * Vector3.forward, Vector3.up);
				Quaternion rotation = val * Quaternion.Euler(0f, 0f, staticCameraRoll);
				moveCamera(staticCameraPos, rotation, staticCameraFOV);
			}
			if (isCameraAnimating && currentCurve != null)
			{
				if (!currentCurve.IsEnabled)
				{
					goToNextCurve();
				}
				float num = currentCurve.duration / 1000f;
				detectFullPauses();
				if (currentOffPrimaryState)
				{
					isCameraPaused = false;
				}
				if (!isCameraPaused)
				{
					cameraLineOffset += Time.deltaTime * (1f / num);
				}
				float adjustedPosition = currentCurve.GetAdjustedPosition(cameraLineOffset);
				if (adjustedPosition <= 1f)
				{
					Vector3 tangent;
					Vector3 val2 = currentCurve.CurvePosToWorldPos(adjustedPosition, 20, out tangent);
					Quaternion val3 = Quaternion.LookRotation(tangent);
					float num2 = 0f;
					livCameraIndicator.SetActive(true);
					if ((Object)(object)RotTargetObject == (Object)null)
					{
						RotTargetObject = GameObject.CreatePrimitive((PrimitiveType)0);
						((Collider)RotTargetObject.GetComponent<SphereCollider>()).enabled = false;
						((Object)RotTargetObject).name = "CamRotTarget";
						RotTargetObject.transform.localScale = Vector3.one * 0.03f;
						RotTargetObject.layer = dontShowOnLIVLayer;
						MeshRenderer component = RotTargetObject.GetComponent<MeshRenderer>();
						((Renderer)component).material = curveMaterial;
						((Renderer)component).material.color = new Color(1f, 0.6f, 0.6f);
						RotTargetObject.transform.SetParent(modParentObject.transform, true);
					}
					if ((Object)(object)FocusTargetObject == (Object)null)
					{
						FocusTargetObject = GameObject.CreatePrimitive((PrimitiveType)0);
						((Collider)FocusTargetObject.GetComponent<SphereCollider>()).enabled = false;
						((Object)FocusTargetObject).name = "CamFocusTarget";
						FocusTargetObject.transform.localScale = Vector3.one * 0.03f;
						FocusTargetObject.layer = dontShowOnLIVLayer;
						MeshRenderer component2 = RotTargetObject.GetComponent<MeshRenderer>();
						((Renderer)component2).material = curveMaterial;
						((Renderer)component2).material.color = new Color(1f, 1f, 0.6f);
						FocusTargetObject.transform.SetParent(modParentObject.transform, true);
					}
					if (currentCurve.RotTarget != null)
					{
						Vector3 val4 = currentCurve.RotTarget.CurvePosToWorldPos(currentCurve.RotTarget.GetAdjustedPosition(adjustedPosition), 20, out tangent);
						val3 = Quaternion.LookRotation(val4 - val2);
						RotTargetObject.SetActive(true);
						RotTargetObject.transform.position = val4;
					}
					if (currentCurve.FocusTarget != null)
					{
						Vector3 position = currentCurve.FocusTarget.CurvePosToWorldPos(currentCurve.FocusTarget.GetAdjustedPosition(adjustedPosition), 20, out tangent);
						FocusTargetObject.SetActive(true);
						FocusTargetObject.transform.position = position;
					}
					cameraRoll = interpolateBetweenMarkers(MarkerPoint.MarkerType.Roll);
					cameraFOV = interpolateBetweenMarkers(MarkerPoint.MarkerType.FOV);
					Quaternion val5 = Quaternion.AngleAxis(cameraRoll, val3 * Vector3.forward);
					Quaternion rotation2 = val5 * val3;
					num2 = cameraFOV;
					moveCamera(val2, rotation2, num2);
				}
				else if (currentCurve.IsLoop)
				{
					cameraLineOffset = 0f;
					passedPauseMarkers.Clear();
				}
				else if (!isPlayingAll)
				{
					stopAnimation();
				}
				else
				{
					goToNextCurve();
				}
			}
			currentTriggerState = RightController.GetTrigger() > triggerThreshold;
			currentGripState = RightController.GetGrip() > gripThreshold;
			currentMainPrimaryState = RightController.GetPrimary() == 1f;
			currentMainSecondaryState = RightController.GetSecondary() == 1f;
			currentOffPrimaryState = LeftController.GetPrimary() == 1f;
			if (swapMainHand)
			{
				if ((Object)(object)rightHandTransform != (Object)null && (Object)(object)leftHandTransform != (Object)null)
				{
					mainHandTransform = leftHandTransform;
					offHandTransform = rightHandTransform;
				}
				currentTriggerState = LeftController.GetTrigger() > triggerThreshold;
				currentGripState = LeftController.GetGrip() > gripThreshold;
				currentMainPrimaryState = LeftController.GetPrimary() == 1f;
				currentMainSecondaryState = LeftController.GetSecondary() == 1f;
				currentOffPrimaryState = RightController.GetPrimary() == 1f;
			}
			if ((settingPlayKey || settingStopKey) && Input.anyKeyDown)
			{
				foreach (KeyCode value in Enum.GetValues(typeof(KeyCode)))
				{
					if (Input.GetKeyDown(value))
					{
						if (settingPlayKey && playKeyCodes.Count < 4 && !playKeyCodes.Contains(value))
						{
							playKeyCodes.Add(value);
						}
						if (settingStopKey && stopKeyCodes.Count < 4 && !playKeyCodes.Contains(value))
						{
							stopKeyCodes.Add(value);
						}
					}
				}
			}
			if (curveEditingEnabled)
			{
				if ((Object)(object)scriptMenu != (Object)null)
				{
					if ((Object)(object)offHandTransform != (Object)null)
					{
						scriptMenu.transform.position = offHandTransform.position;
						scriptMenu.transform.rotation = offHandTransform.rotation * Quaternion.Euler(50f, 0f, 0f);
					}
					if ((Object)(object)mainHandTransform != (Object)null)
					{
						PerformRaycast(mainHandTransform);
					}
				}
				if (!currentTriggerState && previousTriggerState)
				{
					addUndoState();
					isUndoRedoOperation = false;
					buttonUnclick();
				}
				if (!currentGripState && previousGripState)
				{
					addUndoState();
					isUndoRedoOperation = false;
				}
				if (slidingValue != null)
				{
					if (modifyingCurveDuration)
					{
						currentCurve.duration = (int)slidingValue.Slide(mainHandTransform.position);
						updateTexts();
					}
					if (modifyingStaticFOV)
					{
						staticCameraFOV = (int)slidingValue.Slide(mainHandTransform.position);
						updateTexts();
					}
					if (modifyingStaticRoll)
					{
						staticCameraRoll = (int)slidingValue.Slide(mainHandTransform.position) % 360;
						updateTexts();
					}
				}
				editingCurve = currentCurve != null && Curves.Contains(currentCurve);
				if (editingCurve)
				{
					if (!isPointingAtCanvas && !currentCurve.IsHidden && !isMinimized)
					{
						if (selectedTool == Tool.Select)
						{
							selectTool();
						}
						if (selectedTool == Tool.Pen)
						{
							penTool();
						}
						if (selectedTool == Tool.Anchor)
						{
							anchorTool();
						}
						if (addMarkerTools.Contains(selectedTool))
						{
							addMarkerTool(selectedTool);
						}
						else
						{
							Object.Destroy((Object)(object)markerPreview);
							markerPreview = null;
						}
						if (addMarkerTools.Contains(selectedTool) || selectedTool == Tool.SelectMarker || selectedTool == Tool.DeleteMarker)
						{
							MarkerTool();
						}
						if (selectedTool == Tool.DeleteMarker)
						{
							DeleteMarkerTool();
						}
					}
					foreach (Curve curf in Curves)
					{
						if (!curf.IsHidden)
						{
							curf.Render(curf == currentCurve);
						}
					}
					if ((Object)(object)mainHandTransform != (Object)null)
					{
						SelectControl(mainHandTransform.position);
					}
				}
				if (!isPointingAtCanvas && !isMinimized)
				{
					if (selectedTool == Tool.MoveStatic)
					{
						MoveStaticTool();
					}
					if (selectedTool == Tool.GrabStatic)
					{
						GrabStaticTool();
					}
				}
			}
			previousTriggerState = currentTriggerState;
			previousGripState = currentGripState;
			if ((Object)(object)mainHandTransform != (Object)null)
			{
				prevMainHandPos = mainHandTransform.position;
				prevMainHandRot = mainHandTransform.rotation;
			}
		}

		private void stopStatic()
		{
			isCameraStatic = false;
			updateTexts();
			if (cameraAudio)
			{
				try
				{
					((Behaviour)playerAudioListener).enabled = true;
					((Behaviour)camAudioListener).enabled = false;
				}
				catch
				{
				}
			}
		}

		private void playAnimation()
		{
			if (currentCurve != null)
			{
				isCameraAnimating = true;
				stopStatic();
				cameraLineOffset = 0f;
				passedPauseMarkers.Clear();
				if (cameraAudio)
				{
					try
					{
						((Behaviour)playerAudioListener).enabled = false;
						if (useLegacyCam)
						{
							((Behaviour)legacyCamAudioListener).enabled = true;
						}
						else
						{
							((Behaviour)camAudioListener).enabled = true;
						}
					}
					catch
					{
					}
				}
				if (useLegacyCam)
				{
					((Behaviour)legacyCamRC).enabled = false;
				}
			}
			if (playKeyCodes != null)
			{
				SimulateKeyCombo(playKeyCodes);
			}
		}

		private void stopAnimation()
		{
			if ((Object)(object)livCameraIndicator != (Object)null)
			{
				livCameraIndicator.SetActive(false);
			}
			if ((Object)(object)RotTargetObject != (Object)null)
			{
				RotTargetObject.SetActive(false);
			}
			if ((Object)(object)FocusTargetObject != (Object)null)
			{
				FocusTargetObject.SetActive(false);
			}
			isCameraAnimating = false;
			passedPauseMarkers.Clear();
			isCameraPaused = false;
			isPlayingAll = false;
			if (cameraAudio)
			{
				try
				{
					((Behaviour)playerAudioListener).enabled = true;
					((Behaviour)camAudioListener).enabled = false;
				}
				catch
				{
				}
			}
		}

		private void detectFullPauses()
		{
			foreach (MarkerPoint marker in currentCurve.Markers)
			{
				if (marker.Type == MarkerPoint.MarkerType.Pause && marker.Value == -1f && !passedPauseMarkers.Contains(marker) && marker.CurvePos <= currentCurve.GetAdjustedPosition(cameraLineOffset))
				{
					passedPauseMarkers.Add(marker);
					isCameraPaused = true;
				}
			}
		}

		public void SimulateKeyCombo(List<KeyCode> recordedKeys)
		{
		}

		private void addUndoState()
		{
			if (isStateChanging || isUndoRedoOperation)
			{
				return;
			}
			CurveFile curveFile = new CurveFile
			{
				Curves = Curves.Select((Curve curve) => new Curve(curve.Id, curve.RotTargetID, curve.FocusTargetID, curve.Owner)
				{
					ControlPoints = curve.ControlPoints.Select((ControlPoint point) => new ControlPoint(curve, point.WorldPos, point.Handle1, point.Handle2, point.Type)).ToList(),
					Markers = curve.Markers.Select((MarkerPoint marker) => new MarkerPoint(marker.CurveID, marker.CurvePos, marker.Type, marker.Value)).ToList(),
					IsHidden = curve.IsHidden,
					IsEnabled = curve.IsEnabled,
					IsLoop = curve.IsLoop,
					duration = curve.duration
				}).ToList(),
				SelectedCurveID = currentCurve?.Id
			};
			if (undoStates.Count <= 0 || !undoStates.Last().Equals(curveFile))
			{
				undoStates.Add(curveFile);
				if (undoStates.Count > maxUndoStates)
				{
					undoStates.RemoveAt(0);
				}
				statesUndone = 0;
			}
		}

		public float GetDefaultMarkerValue(MarkerPoint.MarkerType type)
		{
			float result = 0f;
			switch (type)
			{
			case MarkerPoint.MarkerType.Pause:
				result = 0f;
				break;
			case MarkerPoint.MarkerType.Roll:
				result = 0f;
				break;
			case MarkerPoint.MarkerType.FOV:
				result = 60f;
				break;
			case MarkerPoint.MarkerType.Speed:
				result = 0f;
				break;
			}
			return result;
		}

		private void moveCamera(Vector3 translation, Quaternion rotation, float fov)
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: 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_0075: Unknown result type (might be due to invalid IL or missing references)
			if (useLegacyCam)
			{
				((Component)legacyCamRC).transform.position = translation;
				((Component)legacyCamRC).transform.rotation = rotation;
				((Component)legacyCamRC).GetComponent<Camera>().fieldOfView = fov;
			}
			else if ((Object)(object)liv != (Object)null && liv.render != null)
			{
				liv.render.SetPose(translation, rotation, fov, false);
			}
			if ((Object)(object)livCameraIndicator != (Object)null)
			{
				livCameraIndicator.transform.position = translation;
				livCameraIndicator.transform.rotation = rotation;
				livCameraIndicator.transform.localScale = new Vector3(60f / fov, 60f / fov, fov / 60f) * 0.1f;
			}
		}

		private float interpolateBetweenMarkers(MarkerPoint.MarkerType type)
		{
			MarkerPoint markerPoint = currentCurve.GetNextMarker(currentCurve.GetAdjustedPosition(cameraLineOffset), type);
			MarkerPoint markerPoint2 = currentCurve.GetPrevMarker(currentCurve.GetAdjustedPosition(cameraLineOffset), type);
			float result = 0f;
			if (markerPoint2 == null)
			{
				markerPoint2 = new MarkerPoint(currentCurve, 0f, type);
				markerPoint2.Value = GetDefaultMarkerValue(type);
			}
			if (markerPoint == null)
			{
				markerPoint = new MarkerPoint(currentCurve, 1f, type);
				markerPoint.Value = markerPoint2.Value;
			}
			float num = markerPoint.CurvePos - markerPoint2.CurvePos;
			float num2 = currentCurve.GetAdjustedPosition(cameraLineOffset) - markerPoint2.CurvePos;
			float by = ((num != 0f) ? (num2 / num) : 0f);
			switch (type)
			{
			case MarkerPoint.MarkerType.Roll:
				result = Lerp(markerPoint2.Value, markerPoint.Value, by);
				break;
			case MarkerPoint.MarkerType.FOV:
				result = Lerp(markerPoint2.Value, markerPoint.Value, by);
				break;
			}
			return result;
		}

		public float Lerp(float firstFloat, float secondFloat, float by)
		{
			return firstFloat * (1f - by) + secondFloat * by;
		}

		private void goToNextCurve()
		{
			if (Curves.IndexOf(currentCurve) == Curves.Count - 1)
			{
				selectCurve(storedSelectedCurve);
				stopAnimation();
				return;
			}
			int index = Curves.IndexOf(currentCurve) + 1;
			selectCurve(index);
			cameraLineOffset = 0f;
			passedPauseMarkers.Clear();
		}

		public Vector3 Snap(Vector3 input)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return input;
		}

		private void selectTool()
		{
			//IL_0033: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			if (currentGripState)
			{
				if (!currentMainPrimaryState && !currentMainSecondaryState)
				{
					currentCurve.OffsetCurve(mainHandTransform.position - prevMainHandPos);
				}
				if (currentMainPrimaryState && !currentMainSecondaryState)
				{
					currentCurve.OffsetCurve((mainHandTransform.position - prevMainHandPos) * 2f);
				}
				if (!currentMainPrimaryState && currentMainSecondaryState)
				{
					currentCurve.OffsetCurve((mainHandTransform.position - prevMainHandPos) * 0.5f);
				}
				if (currentMainPrimaryState && currentMainSecondaryState)
				{
					currentCurve.OffsetCurve((mainHandTransform.position - prevMainHandPos) * 10f);
				}
			}
		}

		private void penTool()
		{
			//IL_0038: 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_00da: 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_0230: Unknown result type (might be due to invalid IL or missing references)
			//IL_0235: 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_01e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
			if (currentTriggerState && !previousTriggerState)
			{
				if (selectedControl == null)
				{
					activeRawPoint = currentCurve.AddPoint(mainHandTransform.position);
				}
				else if (!selectedControl.IsHandle)
				{
					currentCurve.RemovePoint(selectedControl.ControlPoint);
					if (isCameraAnimating && currentCurve.ControlPoints.Count < 2)
					{
						stopAnimation();
					}
				}
			}
			if (currentTriggerState && activeRawPoint != null && Vector3.Distance(mainHandTransform.position, activeRawPoint.WorldPos) > dragThreshold)
			{
				activeRawPoint.SetType(ControlPoint.ControlPointType.Symmetric);
				activeRawPoint.Handle2 = mainHandTransform.position;
				foreach (MarkerPoint marker in currentCurve.Markers)
				{
					marker.SetPosition(marker.CurvePos);
				}
			}
			if (!currentTriggerState && previousTriggerState)
			{
				activeRawPoint = null;
				currentCurve.UpdatePoints();
			}
			if (selectedControl != null && currentGripState)
			{
				if (selectedControl.IsHandle)
				{
					if (selectedControl.HandleIndex == 0)
					{
						selectedControl.ControlPoint.Handle1 = Snap(mainHandTransform.position);
					}
					else
					{
						selectedControl.ControlPoint.Handle2 = Snap(mainHandTransform.position);
					}
				}
				else
				{
					selectedControl.ControlPoint.SetPosition(Snap(mainHandTransform.position));
				}
				foreach (MarkerPoint marker2 in currentCurve.Markers)
				{
					marker2.SetPosition(marker2.CurvePos);
				}
			}
			if (!currentGripState && previousGripState)
			{
				currentCurve.UpdatePoints();
			}
		}

		private void anchorTool()
		{
			//IL_00b0: 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_0197: Unknown result type (might be due to invalid IL or missing references)
			if (currentTriggerState && !previousTriggerState)
			{
				if (selectedControl != null && !selectedControl.IsHandle)
				{
					activeRawPoint = selectedControl.ControlPoint;
				}
				if (selectedControl != null && selectedControl.IsHandle)
				{
					selectedControl.ControlPoint.SetType(ControlPoint.ControlPointType.Corner);
				}
			}
			if (currentTriggerState && activeRawPoint != null)
			{
				activeRawPoint.SetType(ControlPoint.ControlPointType.Symmetric);
				activeRawPoint.Handle2 = mainHandTransform.position;
				foreach (MarkerPoint marker in currentCurve.Markers)
				{
					marker.SetPosition(marker.CurvePos);
				}
			}
			if (!currentTriggerState && previousTriggerState)
			{
				activeRawPoint = null;
				currentCurve.UpdatePoints();
			}
			if (selectedControl != null && currentGripState)
			{
				selectedControl.ControlPoint.SetType(ControlPoint.ControlPointType.Free);
				if (selectedControl.IsHandle)
				{
					if (selectedControl.HandleIndex == 0)
					{
						selectedControl.ControlPoint.Handle1 = mainHandTransform.position;
					}
					else
					{
						selectedControl.ControlPoint.Handle2 = mainHandTransform.position;
					}
				}
				foreach (MarkerPoint marker2 in currentCurve.Markers)
				{
					marker2.SetPosition(marker2.CurvePos);
				}
			}
			if (!currentGripState && previousGripState)
			{
				currentCurve.UpdatePoints();
			}
		}

		private void addMarkerTool(Tool selectedTool)
		{
			//IL_000d: 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_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: 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)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: 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_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: 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_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
			float t = currentCurve.WorldPosToCurvePos(mainHandTransform.position);
			Vector3 tangent;
			Vector3 val = currentCurve.CurvePosToWorldPos(t, 20, out tangent);
			float num = Vector3.Distance(mainHandTransform.position, val);
			MarkerPoint.MarkerType markerType = MarkerPoint.MarkerType.Pause;
			markerType = toolToMarkerType(selectedTool);
			if (num <= pointGripRadius * 2f)
			{
				if (!currentTriggerState)
				{
					if ((Object)(object)markerPreview == (Object)null)
					{
						markerPreview = GameObject.CreatePrimitive((PrimitiveType)0);
						((Collider)markerPreview.GetComponent<SphereCollider>()).enabled = false;
						markerPreview.transform.localScale = Vector3.one * 0.03f * 0.75f * -1f;
						markerPreview.transform.parent = modParentObject.transform;
						markerPreview.layer = dontShowOnLIVLayer;
						MeshRenderer component = markerPreview.GetComponent<MeshRenderer>();
						((Renderer)component).material = curveMaterial;
						((Renderer)component).material.color = Color.yellow;
						markerPreview.transform.position = val;
					}
					else
					{
						markerPreview.transform.position = val;
					}
				}
			}
			else if ((Object)(object)markerPreview != (Object)null)
			{
				Object.Destroy((Object)(object)markerPreview);
				markerPreview = null;
			}
			if (currentTriggerState && !previousTriggerState && SelectedMarker == null && (Object)(object)markerPreview != (Object)null)
			{
				ActiveRawMarker = currentCurve.AddMarker(markerPreview.transform.position, markerType);
				Object.Destroy((Object)(object)markerPreview);
				markerPreview = null;
			}
		}

		private void MarkerTool()
		{
			//IL_00ab: 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_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_026b: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: 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_01fc: Unknown result type (might be due to invalid IL or missing references)
			if (currentTriggerState && !previousTriggerState && SelectedMarker != null)
			{
				ActiveRawMarker = SelectedMarker;
			}
			if (currentTriggerState && ActiveRawMarker != null)
			{
				if (slidingValue != null)
				{
					ActiveRawMarker.setValue(slidingValue.Slide(mainHandTransform.position));
					if (ActiveRawMarker.Type == MarkerPoint.MarkerType.Pause)
					{
						updateTexts();
					}
				}
				if (Vector3.Distance(mainHandTransform.position, ActiveRawMarker.WorldPos) > dragThreshold && slidingValue == null)
				{
					if (ActiveRawMarker.Type == MarkerPoint.MarkerType.Roll)
					{
						slidingValue = new SlideValue(ActiveRawMarker.Value, -2.1474836E+09f, 2.1474836E+09f, 1000f, mainHandTransform.position.y);
					}
					if (ActiveRawMarker.Type == MarkerPoint.MarkerType.FOV)
					{
						slidingValue = new SlideValue(ActiveRawMarker.Value, 1f, 2.1474836E+09f, 100f, mainHandTransform.position.y);
					}
					if (ActiveRawMarker.Type == MarkerPoint.MarkerType.Speed)
					{
						slidingValue = new SlideValue(ActiveRawMarker.Value, 0f, 1f, 10f, mainHandTransform.position.y);
					}
					if (ActiveRawMarker.Type == MarkerPoint.MarkerType.Pause)
					{
						slidingValue = new SlideValue(ActiveRawMarker.Value, -1f, 2.1474836E+09f, 100000f, mainHandTransform.position.y);
					}
				}
			}
			if (!currentTriggerState && previousTriggerState)
			{
				ActiveRawMarker = null;
				slidingValue = null;
			}
			if (currentGripState && SelectedMarker != null)
			{
				SelectedMarker.SetPosition(currentCurve.WorldPosToCurvePos(mainHandTransform.position));
			}
		}

		private void DeleteMarkerTool()
		{
			if (currentTriggerState && !previousTriggerState && SelectedMarker != null)
			{
				currentCurve.RemoveMarker(SelectedMarker);
			}
		}

		private void MoveStaticTool()
		{
			//IL_0029: 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)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: 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_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: 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_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: 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)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//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_00d0: 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_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: 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_014a: Unknown result type (might be due to invalid IL or missing references)
			//IL_014b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: 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_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: 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_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			if (currentGripState)
			{
				if (!currentMainPrimaryState && !currentMainSecondaryState)
				{
					staticCameraPos += mainHandTransform.position - prevMainHandPos;
				}
				if (currentMainPrimaryState && !currentMainSecondaryState)
				{
					staticCameraPos += (mainHandTransform.position - prevMainHandPos) * 2f;
				}
				if (!currentMainPrimaryState && currentMainSecondaryState)
				{
					staticCameraPos += (mainHandTransform.position - prevMainHandPos) * 0.5f;
				}
				if (currentMainPrimaryState && currentMainSecondaryState)
				{
					staticCameraPos += (mainHandTransform.position - prevMainHandPos) * 10f;
				}
				Quaternion val = Quaternion.Inverse(prevMainHandRot) * mainHandTransform.rotation;
				staticCameraRot *= val;
			}
		}

		private void GrabStaticTool()
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: 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_0043: Unknown result type (might be due to invalid IL or missing references)
			if (currentGripState)
			{
				staticCameraPos = mainHandTransform.position + mainHandTransform.forward * 0.1f;
				staticCameraRot = mainHandTransform.rotation;
			}
		}

		private MarkerPoint.MarkerType toolToMarkerType(Tool tool)
		{
			MarkerPoint.MarkerType result = MarkerPoint.MarkerType.Pause;
			switch (tool)
			{
			case Tool.AddPauseMarker:
				result = MarkerPoint.MarkerType.Pause;
				break;
			case Tool.AddRollMarker:
				result = MarkerPoint.MarkerType.Roll;
				break;
			case Tool.AddFOVMarker:
				result = MarkerPoint.MarkerType.FOV;
				break;
			case Tool.AddSpeedMarker:
				result = MarkerPoint.MarkerType.Speed;
				break;
			}
			return result;
		}

		public void renderLine(GameObject gameObject, List<Vector3> points)
		{
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Expected O, but got Unknown
			if (points != null && points.Count >= 2)
			{
				if ((Object)(object)gameObject.GetComponent<MeshFilter>() == (Object)null)
				{
					gameObject.AddComponent<MeshFilter>();
				}
				MeshFilter val = gameObject.GetComponent<MeshFilter>();
				if ((Object)(object)val == (Object)null)
				{
					val = gameObject.AddComponent<MeshFilter>();
				}
				Mesh val3 = (val.mesh = new Mesh());
				Vector3[] array = points.ToArray();
				int[] array2 = new int[(points.Count - 1) * 2];
				for (int i = 0; i < points.Count - 1; i++)
				{
					array2[i * 2] = i;
					array2[i * 2 + 1] = i + 1;
				}
				val3.vertices = Il2CppStructArray<Vector3>.op_Implicit(array);
				val3.SetIndices(Il2CppStructArray<int>.op_Implicit(array2), (MeshTopology)3, 0);
				val3.RecalculateBounds();
			}
		}

		private void PerformRaycast(Transform handTransform)
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: 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_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Expected O, but got Unknown
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			Ray val = default(Ray);
			((Ray)(ref val))..ctor(handTransform.position, handTransform.forward);
			RaycastHit[] array = Il2CppArrayBase<RaycastHit>.op_Implicit((Il2CppArrayBase<RaycastHit>)(object)Physics.RaycastAll(val));
			isPointingAtCanvas = false;
			RaycastHit[] array2 = array;
			for (int i = 0; i < array2.Length; i++)
			{
				RaycastHit val2 = array2[i];
				if (((Component)((RaycastHit)(ref val2)).collider).transform.IsChildOf(scriptMenu.transform))
				{
					isPointingAtCanvas = true;
					if ((Object)(object)uiPointer == (Object)null)
					{
						uiPointer = new GameObject("UIPointer");
						MeshRenderer val3 = uiPointer.AddComponent<MeshRenderer>();
						((Renderer)val3).material = curveMaterial;
						((Renderer)val3).material.color = Color.green;
						uiPointer.transform.SetParent(modParentObject.transform, true);
						uiPointer.layer = dontShowOnLIVLayer;
					}
					uiPointer.SetActive(true);
					renderLine(uiPointer, new List<Vector3>
					{
						handTransform.position,
						((RaycastHit)(ref val2)).point
					});
				}
				if (currentTriggerState && !previousTriggerState)
				{
					buttonClick(((Object)((RaycastHit)(ref val2)).collider).name);
				}
			}
			if (!isPointingAtCanvas && (Object)(object)uiPointer != (Object)null)
			{
				uiPointer.SetActive(false);
			}
		}

		public void buttonClick(string objectName)
		{
			//IL_152b: Unknown result type (might be due to invalid IL or missing references)
			//IL_1575: Unknown result type (might be due to invalid IL or missing references)
			//IL_1742: Unknown result type (might be due to invalid IL or missing references)
			//IL_1702: Unknown result type (might be due to invalid IL or missing references)
			//IL_056d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0572: Unknown result type (might be due to invalid IL or missing references)
			//IL_0578: Unknown result type (might be due to invalid IL or missing references)
			//IL_0585: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a7f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0afb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b05: Unknown result type (might be due to invalid IL or missing references)
			//IL_0be8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bf2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cd5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cdf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0db9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dc3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b35: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b3f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e9d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ea7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c22: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c2c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f81: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f8b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d0a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d14: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dee: Unknown result type (might be due to invalid IL or missing references)
			//IL_0df8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b69: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b73: 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_0edc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c56: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c60: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fb6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fc0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d3c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d46: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e20: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e2a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b9d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ba7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f04: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f0e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c8a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c94: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fe8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ff2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d6e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d78: Unknown result type (might be due to invalid IL or missing references)
			//IL_12c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e52: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e5c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f36: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f40: Unknown result type (might be due to invalid IL or missing references)
			//IL_1258: Unknown result type (might be due to invalid IL or missing references)
			//IL_125d: Unknown result type (might be due to invalid IL or missing references)
			//IL_126a: Expected O, but got Unknown
			//IL_1284: Unknown result type (might be due to invalid IL or missing references)
			//IL_101a: Unknown result type (might be due to invalid IL or missing references)
			//IL_1024: Unknown result type (might be due to invalid IL or missing references)
			if (objectName == "UndoCollider")
			{
				isUndoRedoOperation = true;
				Undo();
			}
			if (objectName == "RedoCollider")
			{
				isUndoRedoOperation = true;
				Redo();
			}
			if (objectName == "CloseCollider")
			{
				curveEditingEnabled = false;
				Mod.Settings[1].Value = false;
				closeMenu();
			}
			if (objectName == "MinimizeCollider")
			{
				Maximized.SetActive(false);
				Minimized.SetActive(true);
				isMinimized = true;
			}
			if (objectName == "MaximizeCollider")
			{
				Maximized.SetActive(true);
				Minimized.SetActive(false);
				isMinimized = false;
			}
			if (objectName == "CreateCurveCollider")
			{
				stopAnimation();
				currentCurve = AddCurve();
				selectCurve(currentCurve);
				selectedTool = Tool.Pen;
			}
			if (objectName == "CreateCircleCollider")
			{
				addCircleCurve();
			}
			if (objectName == "SelectionTabCollider")
			{
				disableAllMenus();
				UISelectMenu.SetActive(true);
			}
			if (objectName == "EditTabCollider")
			{
				disableAllMenus();
				UIEditMenu.SetActive(true);
			}
			if (objectName == "MarkersTabCollider")
			{
				disableAllMenus();
				UIMarkersMenu.SetActive(true);
			}
			if (objectName == "StaticTabCollider")
			{
				disableAllMenus();
				UIStaticMenu.SetActive(true);
			}
			if (objectName == "NetworkTabCollider")
			{
				disableAllMenus();
				UINetworkMenu.SetActive(true);
			}
			if (objectName == "FileTabCollider")
			{
				disableAllMenus();
				UIFileMenu.SetActive(true);
			}
			if (objectName == "SettingsTabCollider")
			{
				disableAllMenus();
				UISettingsMenu.SetActive(true);
			}
			if (Curves.Count > 1)
			{
				if (objectName == "NextCurveCollider")
				{
					if (currentCurve != null)
					{
						selectCurve((Curves.IndexOf(currentCurve) + 1) % Curves.Count);
					}
					else
					{
						selectCurve(Curves.Count - 1);
					}
				}
				if (objectName == "PreviousCurveCollider")
				{
					if (currentCurve != null)
					{
						int num = Curves.IndexOf(currentCurve) - 1;
						if (num < 0)
						{
							num = Curves.Count - 1;
						}
						selectCurve(num);
					}
					else
					{
						selectCurve(Curves.Count - 1);
					}
				}
			}
			if (Curves.Count >= 1)
			{
				if (objectName == "PlayButtonCollider" && currentCurve.IsEnabled)
				{
					playAnimation();
				}
				if (objectName == "PlayAllButtonCollider")
				{
					storedSelectedCurve = currentCurve;
					selectCurve(Curves[0]);
					isPlayingAll = true;
					playAnimation();
				}
				if (objectName == "StopButtonCollider")
				{
					stopAnimation();
					if (stopKeyCodes != null)
					{
						SimulateKeyCombo(stopKeyCodes);
					}
				}
			}
			if (objectName == "LoadCollider")
			{
				loadCurves(readFromFile());
			}
			if (objectName == "AppendCollider")
			{
				appendCurves(readFromFile());
			}
			if (objectName == "OverwriteCollider")
			{
				overwriteCurves(readFromFile());
			}
			if (currentCurve != null)
			{
				if (objectName == "HideCollider")
				{
					if (currentCurve.IsHidden)
					{
						currentCurve.IsHidden = false;
					}
					else
					{
						currentCurve.IsHidden = true;
						currentCurve.Unrender();
					}
					updateTexts();
				}
				if (objectName == "EnableCollider")
				{
					currentCurve.IsEnabled = !currentCurve.IsEnabled;
					updateTexts();
				}
				if (objectName == "LoopCollider")
				{
					currentCurve.IsLoop = !currentCurve.IsLoop;
					updateTexts();
				}
				if (objectName == "ReverseCurveCollider")
				{
					currentCurve.ControlPoints.Reverse();
					foreach (ControlPoint controlPoint in currentCurve.ControlPoints)
					{
						Vector3 handle = controlPoint.Handle1;
						controlPoint.Handle1 = controlPoint.Handle2;
						controlPoint.Handle2 = handle;
					}
					foreach (MarkerPoint marker in currentCurve.Markers)
					{
						marker.SetPosition(marker.CurvePos);
					}
				}
				if (objectName == "DeleteCurveCollider")
				{
					stopAnimation();
					currentCurve.Unrender();
					foreach (Curve curf in Curves)
					{
						if (curf.RotTarget == currentCurve)
						{
							curf.RotTarget = null;
						}
					}
					Curves.Remove(currentCurve);
					Object.Destroy((Object)(object)currentCurve.curveObject);
					if (Curves.Count > 0)
					{
						selectCurve(Curves.Count - 1);
					}
					else
					{
						selectCurve(null);
					}
				}
				if (objectName == "NextCurve2Collider")
				{
					List<Curve> availableTargetCurves = GetAvailableTargetCurves();
					Curve curve = ((currentCurve.RotTarget == null) ? availableTargetCurves[1] : availableTargetCurves[(availableTargetCurves.IndexOf(currentCurve.RotTarget) + 1) % availableTargetCurves.Count]);
					currentCurve.RotTarget = curve;
					if (curve != null)
					{
						currentCurve.RotTargetID = curve.Id;
					}
					((TMP_Text)UISelectedRotTarget.GetComponent<TextMeshProUGUI>()).text = ((curve != null) ? curve.Id : EmptyField);
				}
				if (objectName == "PreviousCurve2Collider")
				{
					List<Curve> availableTargetCurves2 = GetAvailableTargetCurves();
					Curve curve2;
					if (currentCurve.RotTarget != null)
					{
						int num2 = availableTargetCurves2.IndexOf(currentCurve.RotTarget) - 1;
						if (num2 < 0)
						{
							num2 = Curves.Count - 1;
						}
						curve2 = availableTargetCurves2[num2];
					}
					else
					{
						curve2 = availableTargetCurves2[availableTargetCurves2.Count - 1];
					}
					currentCurve.RotTarget = curve2;
					if (curve2 != null)
					{
						currentCurve.RotTargetID = curve2.Id;
					}
					((TMP_Text)UISelectedRotTarget.GetComponent<TextMeshProUGUI>()).text = ((curve2 != null) ? curve2.Id : EmptyField);
				}
				if (objectName == "NextCurve3Collider")
				{
					List<Curve> availableTargetCurves3 = GetAvailableTargetCurves();
					Curve curve3 = ((currentCurve.FocusTarget == null) ? availableTargetCurves3[1] : availableTargetCurves3[(availableTargetCurves3.IndexOf(currentCurve.FocusTarget) + 1) % availableTargetCurves3.Count]);
					currentCurve.FocusTarget = curve3;
					if (curve3 != null)
					{
						currentCurve.FocusTargetID = curve3.Id;
					}
					((TMP_Text)UISelectedFocusTarget.GetComponent<TextMeshProUGUI>()).text = ((curve3 != null) ? curve3.Id : EmptyField);
				}
				if (objectName == "PreviousCurve2Collider")
				{
					List<Curve> availableTargetCurves4 = GetAvailableTargetCurves();
					Curve curve4;
					if (currentCurve.FocusTarget != null)
					{
						int num3 = availableTargetCurves4.IndexOf(currentCurve.FocusTarget) - 1;
						if (num3 < 0)
						{
							num3 = Curves.Count - 1;
						}
						curve4 = availableTargetCurves4[num3];
					}
					else
					{
						curve4 = availableTargetCurves4[availableTargetCurves4.Count - 1];
					}
					currentCurve.FocusTarget = curve4;
					if (curve4 != null)
					{
						currentCurve.FocusTargetID = curve4.Id;
					}
					((TMP_Text)UISelectedFocusTarget.GetComponent<TextMeshProUGUI>()).text = ((curve4 != null) ? curve4.Id : EmptyField);
				}
				if (objectName == "SelectionToolCollider")
				{
					selectedTool = Tool.Select;
					updateToolButtons();
				}
				if (objectName == "PenToolCollider")
				{
					selectedTool = Tool.Pen;
					updateToolButtons();
				}
				if (objectName == "AnchorToolCollider")
				{
					selectedTool = Tool.Anchor;
					updateToolButtons();
				}
				if (objectName == "SetDurationButtonCollider")
				{
					slidingValue = new SlideValue(currentCurve.duration, 1f, 2.1474836E+09f, 10000f, mainHandTransform.position.y);
					modifyingCurveDuration = true;
				}
				if (objectName == "ResetDurationButtonCollider")
				{
					currentCurve.duration = 5000f;
					updateTexts();
				}
				if (objectName == "IncrementXCollider")
				{
					if (!currentMainPrimaryState && !currentMainSecondaryState)
					{
						currentCurve.OffsetCurve(Vector3.right * 0.1f);
					}
					else if (currentMainPrimaryState && !currentMainSecondaryState)
					{
						currentCurve.OffsetCurve(Vector3.right * 0.2f);
					}
					else if (!currentMainPrimaryState && currentMainSecondaryState)
					{
						currentCurve.OffsetCurve(Vector3.right * 0.01f);
					}
					else if (currentMainPrimaryState && currentMainSecondaryState)
					{
						currentCurve.OffsetCurve(Vector3.right * 1f);
					}
				}
				if (objectName == "DecrementXCollider")
				{
					if (!currentMainPrimaryState && !currentMainSecondaryState)
					{
						currentCurve.OffsetCurve(Vector3.left * 0.1f);
					}
					else if (currentMainPrimaryState && !currentMainSecondaryState)
					{
						currentCurve.OffsetCurve(Vector3.left * 0.2f);
					}
					else if (!currentMainPrimaryState && currentMainSecondaryState)
					{
						currentCurve.OffsetCurve(Vector3.left * 0.01f);
					}
					else if (currentMainPrimaryState && currentMainSecondaryState)
					{
						currentCurve.OffsetCurve(Vector3.left * 1f);
					}
				}
				if (objectName == "IncrementYCollider")
				{
					if (!currentMainPrimaryState && !currentMainSecondaryState)
					{
						currentCurve.OffsetCurve(Vector3.up * 0.1f);
					}
					if (currentMainPrimaryState && !currentMainSecondaryState)
					{
						currentCurve.OffsetCurve(Vector3.up * 0.2f);
					}
					if (!currentMainPrimaryState && currentMainSecondaryState)
					{
						currentCurve.OffsetCurve(Vector3.up * 0.01f);
					}
					if (currentMainPrimaryState && currentMainSecondaryState)
					{
						currentCurve.OffsetCurve(Vector3.up * 1f);
					}
				}
				if (objectName == "DecrementYCollider")
				{
					if (!currentMainPrimaryState && !currentMainSecondaryState)
					{
						currentCurve.OffsetCurve(Vector3.down * 0.1f);
					}
					if (currentMainPrimaryState && !currentMainSecondaryState)
					{
						currentCurve.OffsetCurve(Vector3.down * 0.2f);
					}
					if (!currentMainPrimaryState && currentMainSecondaryState)
					{
						currentCurve.OffsetCurve(Vector3.down * 0.01f);
					}
					if (currentMainPrimaryState && currentMainSecondaryState)
					{
						currentCurve.OffsetCurve(Vector3.down * 1f);
					}
				}
				if (objectName == "IncrementZCollider")
				{
					if (!currentMainPrimaryState && !currentMainSecondaryState)
					{
						currentCurve.OffsetCurve(Vector3.forward * 0.1f);
					}
					if (currentMainPrimaryState && !currentMainSecondaryState)
					{
						currentCurve.OffsetCurve(Vector3.forward * 0.2f);
					}
					if (!currentMainPrimaryState && currentMainSecondaryState)
					{
						currentCurve.OffsetCurve(Vector3.forward * 0.01f);
					}
					if (currentMainPrimaryState && currentMainSecondaryState)
					{
						currentCurve.OffsetCurve(Vector3.forward * 1f);
					}
				}
				if (objectName == "DecrementZCollider")
				{
					if (!currentMainPrimaryState && !currentMainSecondaryState)
					{
						currentCurve.OffsetCurve(Vector3.back * 0.1f);
					}
					if (currentMainPrimaryState && !currentMainSecondaryState)
					{
						currentCurve.OffsetCurve(Vector3.back * 0.2f);
					}
					if (!currentMainPrimaryState && currentMainSecondaryState)
					{
						currentCurve.OffsetCurve(Vector3.back * 0.01f);
					}
					if (currentMainPrimaryState && currentMainSecondaryState)
					{
						currentCurve.OffsetCurve(Vector3.back * 1f);
					}
				}
				if (objectName == "SelectMarkerToolCollider")
				{
					selectedTool = Tool.SelectMarker;
					updateToolButtons();
				}
				if (objectName == "AddPauseMarkerToolCollider")
				{
					selectedTool = Tool.AddPauseMarker;
					updateToolButtons();
				}
				if (objectName == "AddRollMarkerToolCollider")
				{
					selectedTool = Tool.AddRollMarker;
					updateToolButtons();
				}
				if (objectName == "AddFOVMarkerToolCollider")
				{
					selectedTool = Tool.AddFOVMarker;
					updateToolButtons();
				}
				if (objectName == "AddSpeedMarkerToolCollider")
				{
					selectedTool = Tool.AddSpeedMarker;
					updateToolButtons();
				}
				if (objectName == "DeleteMarkerToolCollider")
				{
					selectedTool = Tool.DeleteMarker;
					updateToolButtons();
				}
				if (objectName == "SaveCurveCollider")
				{
					curvesToSave.Clear();
					curvesToSave.Add(currentCurve);
					if (currentCurve.RotTarget != null)
					{
						curvesToSave.Add(currentCurve.RotTarget);
					}
					writeToFile(saveStatic: false);
					RefreshFileList();
					UpdateFileUI();
				}
				if (objectName == "SaveAllCurvesCollider")
				{
					curvesToSave.Clear();
					curvesToSave.AddRange(Curves);
					writeToFile(saveStatic: false);
					RefreshFileList();
					UpdateFileUI();
				}
				if (objectName == "UploadCollider")
				{
					List<Curve> list = new List<Curve>();
					list.Add(currentCurve);
					if (currentCurve.RotTarget != null)
					{
						list.Add(currentCurve.RotTarget);
					}
					CurveFile curveFile = new CurveFile
					{
						FileName = "",
						Owner = Managers.GetPlayerManager().LocalPlayer.Data.GeneralData.PlayFabMasterId,
						Curves = list,
						SelectedCurveID = currentCurve?.Id
					};
					string text = JsonConvert.SerializeObject((object)curveFile, (Formatting)1, new JsonSerializerSettings
					{
						ReferenceLoopHandling = (ReferenceLoopHandling)1
					});
					PhotonNetwork.RaiseEvent((byte)32, Object.op_Implicit("N--------" + text), eventOptions, SendOptions.SendReliable);
				}
				if (objectName == "DownloadCollider")
				{
					PhotonNetwork.RaiseEvent((byte)32, Object.op_Implicit("R" + currentCurve.Id + "--"), eventOptions, SendOptions.SendReliable);
				}
				if (objectName == "AcceptCollider" && curveSendRequest != null)
				{
					overwriteCurves(curveSendRequest);
					curveSendRequest = null;
					updateTexts();
				}
				if (objectName == "RejectCollider")
				{
					curveSendRequest = null;
					updateTexts();
				}
				if (objectName == "OrderLeftCollider")
				{
					int num4 = Curves.IndexOf(currentCurve);
					if (num4 > 0)
					{
						Curve value = Curves[num4 - 1];
						Curves[num4 - 1] = currentCurve;
						Curves[num4] = value;
					}
					updateTexts();
				}
				if (objectName == "OrderRightCollider")
				{
					int num5 = Curves.IndexOf(currentCurve);
					if (num5 < Curves.Count - 1)
					{
						Curve value2 = Curves[num5 + 1];
						Curves[num5 + 1] = currentCurve;
						Curves[num5] = value2;
					}
					updateTexts();
				}
			}
			if (objectName == "SaveStaticCollider")
			{
				writeToFile(saveStatic: true);
				RefreshFileList();
				UpdateFileUI();
			}
			if (objectName == "StaticCollider")
			{
				if (!isCameraStatic)
				{
					stopAnimation();
					livCameraIndicator.SetActive(true);
					isCameraStatic = true;
					if (cameraAudio)
					{
						try
						{
							((Behaviour)playerAudioListener).enabled = false;
							if (useLegacyCam)
							{
								((Behaviour)legacyCamAudioListener).enabled = true;
							}
							else
							{
								((Behaviour)camAudioListener).enabled = true;
							}
						}
						catch
						{
						}
					}
				}
				else
				{
					livCameraIndicator.SetActive(false);
					isCameraStatic = false;
				}
				updateTexts();
			}
			if (objectName == "SetFOVCollider")
			{
				slidingValue = new SlideValue(staticCameraFOV, 1f, 2.1474836E+09f, 100f, mainHandTransform.position.y);
				modifyingStaticFOV = true;
			}
			if (objectName == "SetRollCollider")
			{
				slidingValue = new SlideValue(staticCameraRoll, -2.1474836E+09f, 2.1474836E+09f, 1000f, mainHandTransform.position.y);
				modifyingStaticRoll = true;
			}
			if (objectName == "MoveStaticToolCollider")
			{
				selectedTool = Tool.MoveStatic;
				updateToolButtons();
			}
			if (objectName == "GrabStaticToolCollider")
			{
				selectedTool = Tool.GrabStatic;
				updateToolButtons();
			}
			if (objectName == "RefreshFilesCollider")
			{
				RefreshFileList();
				UpdateFileUI();
			}
			if (objectName == "NextFilesCollider" && (filePage + 1) * UIfileOptions.Count < fileNames.Count)
			{
				filePage++;
				UpdateFileUI();
			}
			if (objectName == "PrevFilesCollider" && filePage > 0)
			{
				filePage--;
				UpdateFileUI();
			}
			if (objectName.Contains("FileOptionCollider"))
			{
				selectedFileOption = int.Parse(objectName.Replace("FileOptionCollider", ""));
				UpdateFileUI();
				for (int i = 0; i < UIfileOptions.Count; i++)
				{
					if (i == selectedFileOption)
					{
						((Graphic)((Component)UIfileOptions[i].transform.GetChild(0)).GetComponent<Image>()).color = new Color(0.337f, 0.604f, 0.337f, 1f);
					}
					else
					{
						((Graphic)((Component)UIfileOptions[i].transform.GetChild(0)).GetComponent<Image>()).color = new Color(0.094f, 0.094f, 0.094f, 1f);
					}
				}
			}
			if (objectName == "LoadInGymCollider")
			{
				ToggleLoadInList(loadInGym, UILoadInGym);
			}
			if (objectName == "LoadInParkCollider")
			{
				ToggleLoadInList(loadInPark, UILoadInPark);
			}
			if (objectName == "LoadInRingCollider")
			{
				ToggleLoadInList(loadInRing, UILoadInRing);
			}
			if (objectName == "LoadInPitCollider")
			{
				ToggleLoadInList(loadInPit, UILoadInPit);
			}
			if (objectName == "SwapHandsCollider")
			{
				swapMainHand = !swapMainHand;
				updateTexts();
			}
			if (objectName == "SnapPositionCollider")
			{
				snapPosition = !snapPosition;
				updateTexts();
			}
			if (objectName == "SnapRotationCollider")
			{
				snapRotation = !snapRotation;
				updateTexts();
			}
			if (objectName == "CameraAudioCollider")
			{
				if (cameraAudio)
				{
					cameraAudio = false;
					((Behaviour)playerAudioListener).enabled = true;
					((Behaviour)camAudioListener).enabled = false;
				}
				else
				{
					cameraAudio = true;
				}
				updateTexts();
			}
			if (objectName == "HideTagsCollider")
			{
				hideTags = !hideTags;
				setTagsVisibility(!hideTags);
				updateTexts();
			}
		}

		private void setTagsVisibility(bool visible)
		{
			//IL_007e: 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_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: 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_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: 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_01c2: Unknown result type (might be due to invalid IL or missing references)
			Enumerator<Player> enumerator = Managers.GetPlayerManager().AllPlayers.GetEnumerator();
			while (enumerator.MoveNext())
			{
				Player current = enumerator.Current;
				PlayerController controller = current.Controller;
				GameObject val = null;
				GameObject val2 = null;
				if (current != Managers.GetPlayerManager().LocalPlayer)
				{
					val = ((Component)((Component)controller).transform.GetChild(5)).gameObject;
					val2 = ((Component)((Component)controller).transform.GetChild(9)).gameObject;
				}
				else
				{
					val = localHealthBar;
				}
				LayerMask val3 = LayerMask.op_Implicit(LayerMask.NameToLayer("Default"));
				if (!visible)
				{
					val3 = LayerMask.op_Implicit(dontShowOnLIVLayer);
				}
				if ((Object)(object)val != (Object)null)
				{
					((Component)val.transform.GetChild(0).GetChild(0)).gameObject.layer = LayerMask.op_Implicit(val3);
					((Component)val.transform.GetChild(0).GetChild(1).GetChild(0)).gameObject.layer = LayerMask.op_Implicit(val3);
					((Component)val.transform.GetChild(0).GetChild(1).GetChild(1)).gameObject.layer = LayerMask.op_Implicit(val3);
					((Component)val.transform.GetChild(0).GetChild(1).GetChild(2)).gameObject.layer = LayerMask.op_Implicit(val3);
					((Component)val.transform.GetChild(1).GetChild(0)).gameObject.layer = LayerMask.op_Implicit(val3);
					((Component)val.transform.GetChild(1).GetChild(1)).gameObject.layer = LayerMask.op_Implicit(val3);
				}
				if ((Object)(object)val2 != (Object)null)
				{
					for (int i = 0; i < val2.transform.childCount; i++)
					{
						((Component)val2.transform.GetChild(i)).gameObject.layer = LayerMask.op_Implicit(val3);
					}
				}
			}
		}

		private void ToggleLoadInList(List<string> loadList, GameObject uiButton)
		{
			//IL_009f: 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)
			int num = filePage * UIfileOptions.Count + selectedFileOption;
			if (num < fileNames.Count)
			{
				string item = fileNames[num];
				if (loadList.Contains(item))
				{
					loadList.Remove(item);
					((Graphic)uiButton.GetComponent<Image>()).color = new Color(0.194f, 0.358f, 0.215f, 1f);
				}
				else
				{
					loadList.Add(item);
					((Graphic)uiButton.GetComponent<Image>()).color = new Color(0.338f, 0.603f, 0.338f, 1f);
				}
				SaveOtherSettings();
			}
		}

		private void addCircleCurve()
		{
			//IL_002b: 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_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: 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_0069: 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_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: 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_00b0: 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_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: 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_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: 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_014e: Unknown result type (might be due to invalid IL or missing references)
			Curve curve = AddCurve();
			curve.IsLoop = true;
			float num = 0.5522848f;
			float num2 = 0.25f;
			curve.AddPoint(new Vector3(1f, 0f, 0f) * num2, new Vector3(1f, 0f, 0f - num) * num2);
			curve.AddPoint(new Vector3(0f, 0f, 1f) * num2, new Vector3(num, 0f, 1f) * num2);
			curve.AddPoint(new Vector3(-1f, 0f, 0f) * num2, new Vector3(-1f, 0f, num) * num2);
			curve.AddPoint(new Vector3(0f, 0f, -1f) * num2, new Vector3(0f - num, 0f, -1f) * num2);
			curve.AddPoint(new Vector3(1f, 0f, 0f) * num2, new Vector3(1f, 0f, 0f - num) * num2);
			currentCurve = curve;
			curve.UpdatePoints();
			curve.Render(selected: true);
			curve.OffsetCurve(mainHandTransform.position);
			updateTexts();
		}

		private void Undo()
		{
			if (undoStates.Count - statesUndone > 1)
			{
				statesUndone++;
				isStateChanging = true;
				loadCurves(undoStates[undoStates.Count - 1 - statesUndone]);
				isStateChanging = false;
			}
		}

		private void Redo()
		{
			if (statesUndone > 0)
			{
				statesUndone--;
				isStateChanging = true;
				loadCurves(undoStates[undoStates.Count - 1 - statesUndone]);
				isStateChanging = false;
			}
		}

		private void loadCurves(CurveFile curveFile)
		{
			//IL_002c: 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_003d: 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_0170: Unknown result type (might be due to invalid IL or missing references)
			CurveFile curveFile2 = curveFile;
			if (curveFile2.IsStatic)
			{
				isCameraStatic = true;
				staticCameraPos = curveFile2.StaticCameraPos;
				staticCameraRot = curveFile2.StaticCameraRot;
				staticCameraFOV = curveFile2.StaticFOV;
				staticCameraRoll = curveFile2.StaticRoll;
				livCameraIndicator.SetActive(true);
				updateTexts();
				return;
			}
			foreach (Curve curf in Curves)
			{
				curf.Unrender();
			}
			Curves.Clear();
			Curves = curveFile2.Curves.Select((Curve curve) => new Curve(curve.Id, curve.RotTargetID, curve.FocusTargetID, curve.Owner)
			{
				ControlPoints = curve.ControlPoints.Select((ControlPoint point) => new ControlPoint(curve, point.WorldPos, point.Handle1, point.Handle2, point.Type)).ToList(),
				Markers = curve.Markers.Select((MarkerPoint marker) => new MarkerPoi