Decompiled source of MonoDirector v1.2.8

Mods/MonoDirector.dll

Decompiled a week ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Net.Security;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Cryptography.X509Certificates;
using System.Security.Permissions;
using System.Threading.Tasks;
using AudioImportLib;
using BoneLib;
using BoneLib.BoneMenu;
using BoneLib.Notifications;
using HarmonyLib;
using Il2CppInterop.Runtime;
using Il2CppInterop.Runtime.InteropTypes;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppMK.Glow.URP;
using Il2CppSLZ.Bonelab;
using Il2CppSLZ.Data;
using Il2CppSLZ.Marrow;
using Il2CppSLZ.Marrow.Audio;
using Il2CppSLZ.Marrow.Combat;
using Il2CppSLZ.Marrow.Data;
using Il2CppSLZ.Marrow.Interaction;
using Il2CppSLZ.Marrow.Pool;
using Il2CppSLZ.Marrow.Warehouse;
using Il2CppSLZ.VRMK;
using Il2CppSystem;
using Il2CppSystem.Collections.Generic;
using Il2CppTMPro;
using MelonLoader;
using MelonLoader.Utils;
using Microsoft.CodeAnalysis;
using NEP.MonoDirector;
using NEP.MonoDirector.Actors;
using NEP.MonoDirector.Audio;
using NEP.MonoDirector.Cameras;
using NEP.MonoDirector.Core;
using NEP.MonoDirector.Data;
using NEP.MonoDirector.Downloading;
using NEP.MonoDirector.Patches;
using NEP.MonoDirector.Proxy;
using NEP.MonoDirector.State;
using NEP.MonoDirector.UI;
using Newtonsoft.Json;
using UnityEngine;
using UnityEngine.Audio;
using UnityEngine.Events;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("MonoDirector")]
[assembly: AssemblyDescription("A movie/photo making utility for BONELAB!")]
[assembly: AssemblyCompany("Not Enough Photons")]
[assembly: AssemblyProduct("MonoDirector")]
[assembly: AssemblyCopyright("Developed by Not Enough Photons")]
[assembly: AssemblyTrademark("Not Enough Photons")]
[assembly: AssemblyFileVersion("1.2.8")]
[assembly: MelonInfo(typeof(Main), "MonoDirector", "1.2.8", "Not Enough Photons", "https://bonelab.thunderstore.io/c/bonelab/p/NotEnoughPhotons/MonoDirector")]
[assembly: MelonGame("Stress Level Zero", "BONELAB")]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.2.8.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.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;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
public static class SeatPatches
{
	[HarmonyPatch(typeof(Seat))]
	[HarmonyPatch("Register")]
	public static class Register
	{
		public static void Postfix(Seat __instance, RigManager rM)
		{
			Logging.Msg("Register Rig");
			Actor activeActor = Recorder.Instance.ActiveActor;
			if (activeActor != null)
			{
				activeActor.RecordAction(delegate
				{
					activeActor.ParentToSeat(__instance);
				});
			}
		}
	}

	[HarmonyPatch(typeof(Seat))]
	[HarmonyPatch("DeRegister")]
	public static class DeRegister
	{
		public static void Postfix()
		{
			Logging.Msg("Deregister Rig");
			Actor activeActor = Recorder.Instance.ActiveActor;
			if (activeActor != null)
			{
				activeActor.RecordAction(delegate
				{
					activeActor.UnparentSeat();
				});
			}
		}
	}
}
namespace NEP.MonoDirector
{
	public static class BuildInfo
	{
		public const int Epoch = 1714117050;

		public const string GitCommit = "ec2844ecb154a593f0ef77324339a262a2fbed2d";

		public const string Name = "MonoDirector";

		public const string Description = "A movie/photo making utility for BONELAB!";

		public const string Author = "Not Enough Photons";

		public const string Company = "Not Enough Photons";

		public const string Version = "1.2.8";

		public const string DownloadLink = "https://bonelab.thunderstore.io/c/bonelab/p/NotEnoughPhotons/MonoDirector";
	}
	public static class Constants
	{
		public static readonly string dirBase = Path.Combine(MelonEnvironment.UserDataDirectory, "Not Enough Photons");

		public static readonly string dirMod = Path.Combine(dirBase, "MonoDirector");

		public static readonly string dirImg = Path.Combine(dirMod, "Images/");

		public static readonly string dirSFX = Path.Combine(dirMod, "SFX/");

		public static RigManager RigManager => Player.RigManager;
	}
	public static class Events
	{
		public static Action<Actor> OnActorCasted;

		public static Action<Actor> OnActorUncasted;

		public static Action<Prop> OnPropCreated;

		public static Action<Prop> OnPropRemoved;

		public static Action OnSessionBegin;

		public static Action OnSessionEnd;

		public static Action OnPrePlayback;

		public static Action OnPreRecord;

		public static Action OnPlay;

		public static Action OnPause;

		public static Action OnStopPlayback;

		public static Action OnStartRecording;

		public static Action OnStopRecording;

		public static Action OnPlaybackTick;

		public static Action OnRecordTick;

		public static Action OnPrePhotograph;

		public static Action OnPhotograph;

		public static Action OnPostPhotograph;

		public static Action OnTimerCountdown;

		public static Action<PlayState> OnPlayStateSet;

		public static Action<CameraMode> OnCameraModeSet;

		public static Action OnPreSnapshot;

		public static void FlushActions()
		{
			OnActorCasted = null;
			OnSessionBegin = null;
			OnSessionEnd = null;
			OnPrePlayback = null;
			OnPreRecord = null;
			OnPlay = null;
			OnPause = null;
			OnStopPlayback = null;
			OnStartRecording = null;
			OnStopRecording = null;
			OnPlaybackTick = null;
			OnRecordTick = null;
			OnPreSnapshot = null;
			OnPrePhotograph = null;
			OnPostPhotograph = null;
			OnPhotograph = null;
			OnPlayStateSet = null;
			OnCameraModeSet = null;
			OnTimerCountdown = null;
		}
	}
	public class Main : MelonMod
	{
		public override void OnInitializeMelon()
		{
			Bootstrap.Initialize();
		}

		public override void OnDeinitializeMelon()
		{
			Bootstrap.Shutdown();
		}
	}
	public class Photographer
	{
		[CompilerGenerated]
		private sealed class <PhotographRoutine>d__11 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public Photographer <>4__this;

			private int <i>5__2;

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

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

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

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

			private bool MoveNext()
			{
				//IL_005a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0064: Expected O, but got Unknown
				int num = <>1__state;
				Photographer photographer = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					Events.OnPrePhotograph?.Invoke();
					<i>5__2 = 0;
					goto IL_0084;
				case 1:
					<>1__state = -1;
					<i>5__2++;
					goto IL_0084;
				case 2:
					{
						<>1__state = -1;
						return false;
					}
					IL_0084:
					if (<i>5__2 < photographer.Delay)
					{
						Events.OnTimerCountdown?.Invoke();
						<>2__current = (object)new WaitForSeconds((float)photographer.Delay);
						<>1__state = 1;
						return true;
					}
					Events.OnPhotograph?.Invoke();
					Events.OnPostPhotograph?.Invoke();
					<>2__current = null;
					<>1__state = 2;
					return true;
				}
			}

			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 Actor m_activeActor;

		private Actor m_lastActor;

		public int Delay { get; set; }

		public Photographer()
		{
			Events.OnPrePhotograph = (Action)Delegate.Combine(Events.OnPrePhotograph, new Action(OnPrePhotograph));
			Events.OnPhotograph = (Action)Delegate.Combine(Events.OnPhotograph, new Action(OnPhotograph));
			Events.OnPostPhotograph = (Action)Delegate.Combine(Events.OnPostPhotograph, new Action(OnPostPhotograph));
		}

		public void SetActor(Avatar avatar)
		{
			m_lastActor = m_activeActor;
			m_activeActor = new Actor(avatar);
		}

		public void OnPrePhotograph()
		{
		}

		public void OnPhotograph()
		{
		}

		public void OnPostPhotograph()
		{
		}

		[IteratorStateMachine(typeof(<PhotographRoutine>d__11))]
		public IEnumerator PhotographRoutine()
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <PhotographRoutine>d__11(0)
			{
				<>4__this = this
			};
		}
	}
	public static class Settings
	{
		public static class Camera
		{
			public static float cameraSpeedSlow;

			public static float cameraSpeedFast;

			public static float cameraSmoothRotationDelta;

			public static bool useHeadCamera;

			public static bool handheldLockXAxis;

			public static bool handheldLockYAxis;

			public static bool handheldLockZAxis;

			public static bool handheldKinematicOnRelease;
		}

		public static class World
		{
			public static int delay = 2;

			public static bool useMicrophone = false;

			public static bool micPlayback = false;

			public static float playbackRate = 1f;

			public static float fps = 60f;

			public static bool ignoreSlomo = false;

			public static bool temporalScaling = false;

			public static bool recordActors = true;
		}

		public static class Debug
		{
			public static bool debugEnabled = true;

			public static bool useKeys = true;
		}
	}
}
namespace NEP.MonoDirector.UI
{
	public static class ActorFrameManager
	{
		private static GameObject container;

		private static Dictionary<ActorProxy, GameObject> frames;

		private static List<GameObject> loadedFrameObjects;

		private static List<GameObject> activeFrames;

		public static void Initialize()
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Expected O, but got Unknown
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			frames = new Dictionary<ActorProxy, GameObject>();
			loadedFrameObjects = new List<GameObject>();
			activeFrames = new List<GameObject>();
			container = new GameObject("[MonoDirector] - Actor Frame Container");
			container.transform.SetParent(Bootstrap.MainContainerObject.transform);
			for (int i = 0; i < 32; i++)
			{
				GameObject val = Object.Instantiate<GameObject>(BundleLoader.FrameObject);
				val.SetActive(false);
				val.transform.SetParent(container.transform);
				val.transform.localPosition = Vector3.zero;
				loadedFrameObjects.Add(val);
			}
		}

		public static void CleanUp()
		{
			frames.Clear();
			loadedFrameObjects.Clear();
			activeFrames.Clear();
		}

		public static GameObject AddFrameToActor(ActorProxy proxy)
		{
			//IL_0061: 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)
			if (frames.ContainsKey(proxy))
			{
				return null;
			}
			GameObject val = ((IEnumerable<GameObject>)loadedFrameObjects).FirstOrDefault((Func<GameObject, bool>)((GameObject frame) => !activeFrames.Contains(frame)));
			val.gameObject.SetActive(true);
			val.transform.SetParent(((Component)proxy.Collider).transform);
			val.transform.localPosition = Vector3.zero;
			val.transform.localScale = proxy.Collider.size;
			frames.Add(proxy, val);
			activeFrames.Add(val);
			return val;
		}

		public static void RemoveFrameFromActor(ActorProxy proxy)
		{
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			if (frames.ContainsKey(proxy))
			{
				Poolee component = frames[proxy].GetComponent<Poolee>();
				component.Despawn();
				((Component)component).gameObject.SetActive(false);
				((Component)component).transform.parent = container.transform;
				((Component)component).transform.localScale = Vector3.one;
				frames.Remove(proxy);
				activeFrames.Remove(((Component)component).gameObject);
			}
		}

		internal static void OnFrameSpawned(GameObject frameObject)
		{
			frameObject.SetActive(false);
			frameObject.transform.SetParent(container.transform);
			loadedFrameObjects.Add(frameObject);
		}
	}
	[RegisterTypeInIl2Cpp]
	public class ActorPanel : MonoBehaviour
	{
		private Transform m_root;

		private TextMeshProUGUI m_actorNameText;

		private Button m_recastButton;

		private Button m_deleteButton;

		private Action m_onRecastClicked;

		private Action m_onDeleteClicked;

		private Vector3 m_targetPosition;

		public ActorPanel(IntPtr ptr)
			: base(ptr)
		{
		}

		private void Awake()
		{
			m_root = ((Component)this).transform.GetChild(0);
			m_actorNameText = ((Component)m_root.Find("ActorName")).GetComponent<TextMeshProUGUI>();
			m_recastButton = ((Component)m_root.Find("Management/Recast")).GetComponent<Button>();
			m_deleteButton = ((Component)m_root.Find("Management/Delete")).GetComponent<Button>();
			m_onRecastClicked = OnRecastClicked;
			m_onDeleteClicked = OnDeleteClicked;
			((Component)m_root).gameObject.SetActive(false);
		}

		private void OnEnable()
		{
			Director.OnActorSelected += OnActorSelected;
			Director.OnActorDeselected += OnActorDeselected;
			((UnityEvent)m_recastButton.onClick).AddListener(UnityAction.op_Implicit(m_onRecastClicked));
			((UnityEvent)m_deleteButton.onClick).AddListener(UnityAction.op_Implicit(m_onDeleteClicked));
		}

		private void OnDisable()
		{
			Director.OnActorSelected -= OnActorSelected;
			Director.OnActorDeselected -= OnActorDeselected;
			((UnityEvent)m_recastButton.onClick).RemoveListener(UnityAction.op_Implicit(m_onRecastClicked));
			((UnityEvent)m_deleteButton.onClick).RemoveListener(UnityAction.op_Implicit(m_onDeleteClicked));
		}

		private void Update()
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: 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_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_003e: 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_0054: 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_0074: Unknown result type (might be due to invalid IL or missing references)
			Quaternion val = Quaternion.LookRotation(((Rig)Constants.RigManager.physicsRig).m_head.position - ((Component)this).transform.position);
			Vector3 eulerAngles = ((Quaternion)(ref val)).eulerAngles;
			((Component)this).transform.position = Vector3.Lerp(((Component)this).transform.position, m_targetPosition, 8f * Time.deltaTime);
			((Component)this).transform.rotation = Quaternion.Euler(0f, eulerAngles.y, 0f);
		}

		private void OnActorSelected(Actor actor)
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			((Component)m_root).gameObject.SetActive(true);
			m_targetPosition = actor.ActorBody.Chest.transform.position + Vector3.right;
			((TMP_Text)m_actorNameText).text = actor.ActorName;
		}

		private void OnActorDeselected(Actor actor)
		{
			((Component)m_root).gameObject.SetActive(false);
		}

		private void OnRecastClicked()
		{
			Director.Recast(Director.SelectedActor);
			((Component)m_root).gameObject.SetActive(false);
		}

		private void OnDeleteClicked()
		{
			Director.RemoveActor(Director.SelectedActor);
			((Component)m_root).gameObject.SetActive(false);
		}
	}
	public static class InfoInterfaceManager
	{
		public static void Initialize()
		{
			WarehouseLoader.SpawnFromBarcode(WarehouseLoader.infoInterfaceBarcode);
		}
	}
	[RegisterTypeInIl2Cpp]
	public class InformationInterface : MonoBehaviour
	{
		private GameObject microIconsObject;

		private GameObject timecodeObject;

		private GameObject playmodeObject;

		private GameObject countdownObject;

		private GameObject micObject;

		private GameObject micOffObject;

		private TextMeshProUGUI timecodeText;

		private TextMeshProUGUI playmodeText;

		private TextMeshProUGUI countdownText;

		private Animator countdownAnimator;

		private PlayState playState;

		private bool showUI;

		private bool showIcons;

		private bool showTimecode;

		private bool showPlaymode;

		public static InformationInterface Instance { get; private set; }

		public bool ShowUI
		{
			get
			{
				return showUI;
			}
			set
			{
				showUI = value;
				ShowIcons = showUI;
				ShowTimecode = showUI;
				ShowPlaymode = showUI;
			}
		}

		public bool ShowIcons
		{
			get
			{
				return showIcons;
			}
			set
			{
				showIcons = value;
				GameObject obj = microIconsObject;
				if (obj != null)
				{
					obj.SetActive(showIcons);
				}
			}
		}

		public bool ShowTimecode
		{
			get
			{
				return showTimecode;
			}
			set
			{
				showTimecode = value;
				GameObject obj = timecodeObject;
				if (obj != null)
				{
					obj.SetActive(showTimecode);
				}
			}
		}

		public bool ShowPlaymode
		{
			get
			{
				return showPlaymode;
			}
			set
			{
				showPlaymode = value;
				GameObject obj = playmodeObject;
				if (obj != null)
				{
					obj.SetActive(showPlaymode);
				}
			}
		}

		public InformationInterface(IntPtr ptr)
			: base(ptr)
		{
		}

		private void Awake()
		{
			Instance = this;
			microIconsObject = ((Component)((Component)this).transform.Find("MicroIcons")).gameObject;
			timecodeObject = ((Component)((Component)this).transform.Find("Timecode")).gameObject;
			playmodeObject = ((Component)((Component)this).transform.Find("Playmode")).gameObject;
			countdownObject = ((Component)((Component)this).transform.Find("Countdown")).gameObject;
			micObject = ((Component)microIconsObject.transform.Find("Microphone/Mic")).gameObject;
			micOffObject = ((Component)microIconsObject.transform.Find("Microphone/Disabled")).gameObject;
			timecodeText = ((Component)timecodeObject.transform.Find("Time")).GetComponent<TextMeshProUGUI>();
			playmodeText = ((Component)playmodeObject.transform.Find("Mode")).GetComponent<TextMeshProUGUI>();
			countdownText = ((Component)countdownObject.transform.Find("Counter")).GetComponent<TextMeshProUGUI>();
			countdownAnimator = countdownObject.GetComponent<Animator>();
		}

		private void Start()
		{
			Events.OnPlayStateSet = (Action<PlayState>)Delegate.Combine(Events.OnPlayStateSet, new Action<PlayState>(OnPlayStateSet));
			Events.OnPrePlayback = (Action)Delegate.Combine(Events.OnPrePlayback, new Action(OnSceneStart));
			Events.OnPlaybackTick = (Action)Delegate.Combine(Events.OnPlaybackTick, new Action(OnSceneTick));
			Events.OnStopPlayback = (Action)Delegate.Combine(Events.OnStopPlayback, new Action(OnSceneEnd));
			Events.OnPreRecord = (Action)Delegate.Combine(Events.OnPreRecord, new Action(OnSceneStart));
			Events.OnStartRecording = (Action)Delegate.Combine(Events.OnStartRecording, new Action(OnStartRecording));
			Events.OnRecordTick = (Action)Delegate.Combine(Events.OnRecordTick, new Action(OnSceneTick));
			Events.OnStopRecording = (Action)Delegate.Combine(Events.OnStopRecording, new Action(OnSceneEnd));
			Events.OnTimerCountdown = (Action)Delegate.Combine(Events.OnTimerCountdown, new Action(OnTimerCountdown));
			showIcons = false;
			showTimecode = false;
			showPlaymode = false;
			microIconsObject.SetActive(false);
			timecodeObject.SetActive(false);
			playmodeObject.SetActive(false);
			countdownObject.SetActive(false);
		}

		private void Update()
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//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_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			micOffObject.SetActive(!Settings.World.useMicrophone);
			Transform head = Player.Head;
			((Component)this).transform.position = Vector3.Lerp(((Component)this).transform.position, head.position + head.forward, 16f * Time.deltaTime);
			((Component)this).transform.localScale = new Vector3(-1f, 1f, 1f);
			((Component)this).transform.LookAt(head);
		}

		public void OnSceneStart()
		{
			if (Director.PlayState == PlayState.Prerecording)
			{
				((TMP_Text)timecodeText).text = "0s";
				countdownObject.SetActive(true);
			}
		}

		public void OnStartRecording()
		{
			countdownObject.SetActive(false);
		}

		public void OnSceneTick()
		{
			float num = 0f;
			if (playState == PlayState.Playing)
			{
				num = Playback.Instance.PlaybackTime;
			}
			if (playState == PlayState.Recording)
			{
				num = Recorder.Instance.RecordingTime;
			}
			((TMP_Text)timecodeText).text = num.ToString("0.000") + "s";
		}

		public void OnSceneEnd()
		{
		}

		public void OnTimerCountdown()
		{
			countdownObject.SetActive(false);
			int num = ((Director.PlayState == PlayState.Prerecording) ? Recorder.Instance.Countdown : Playback.Instance.Countdown);
			int num2 = Settings.World.delay - num;
			((TMP_Text)countdownText).text = num2.ToString();
			countdownObject.SetActive(true);
			countdownAnimator.Play("Countdown");
		}

		private void OnPlayStateSet(PlayState playState)
		{
			this.playState = playState;
			((TMP_Text)playmodeText).text = playState.ToString();
		}
	}
	public class ActorDisplayPage
	{
		public List<Actor> actorEntries;

		private ActorsPage pageInstance;

		public int capacity { get; private set; } = 8;


		public int count { get; private set; }

		public ActorDisplayPage()
		{
			actorEntries = new List<Actor>();
		}

		public void AddActor(Actor actor)
		{
			if (count + 1 > capacity)
			{
				pageInstance.OnPageFilled(actor);
				return;
			}
			actorEntries.Add(actor);
			count++;
		}

		public void RemoveActor(Actor actor)
		{
			if (count == 0)
			{
				count = 0;
				return;
			}
			actorEntries.Remove(actor);
			count--;
		}

		public void LinkToView(ActorsPage instance)
		{
			pageInstance = instance;
		}
	}
	[RegisterTypeInIl2Cpp]
	public class ActorEntry : MonoBehaviour
	{
		public RawImage avatarImage;

		public TextMeshProUGUI avatarNameText;

		public Button avatarButton;

		private Actor actor;

		public ActorEntry(IntPtr ptr)
			: base(ptr)
		{
		}

		public void Show()
		{
			((Component)this).gameObject.SetActive(true);
		}

		public void Hide()
		{
			((Component)this).gameObject.SetActive(false);
		}

		public Actor GetActor()
		{
			return actor;
		}

		public void SetActor(Actor actor)
		{
			this.actor = actor;
		}
	}
	[RegisterTypeInIl2Cpp]
	public class ActorSettingsPage : MonoBehaviour
	{
		private MDMenu menu;

		private RawImage actorPortrait;

		private TextMeshProUGUI actorNameText;

		private TextMeshProUGUI visiblityButtonText;

		private Button visibilityButton;

		private Button recastButton;

		private Button deleteButton;

		private Button deletePropsButton;

		private Actor actor;

		private bool initialized;

		public ActorSettingsPage(IntPtr ptr)
			: base(ptr)
		{
		}

		public void Initialize(MDMenu menu)
		{
			if (!initialized)
			{
				this.menu = menu;
				actorPortrait = ((Component)((Component)this).transform.GetChild(0)).GetComponent<RawImage>();
				actorNameText = ((Component)((Component)this).transform.GetChild(1)).GetComponent<TextMeshProUGUI>();
				Transform val = ((Component)this).transform.Find("OptionsGroup");
				visibilityButton = ((Component)val.GetChild(0)).GetComponent<Button>();
				visiblityButtonText = ((Component)((Component)visibilityButton).transform.GetChild(0)).GetComponent<TextMeshProUGUI>();
				recastButton = ((Component)val.GetChild(1)).GetComponent<Button>();
				deleteButton = ((Component)val.GetChild(2)).GetComponent<Button>();
				deletePropsButton = ((Component)val.GetChild(3)).GetComponent<Button>();
				((UnityEvent)visibilityButton.onClick).AddListener(UnityAction.op_Implicit((Action)delegate
				{
					OnShowButtonClicked();
				}));
				((UnityEvent)recastButton.onClick).AddListener(UnityAction.op_Implicit((Action)delegate
				{
					OnRecastButtonClicked();
				}));
				((UnityEvent)deleteButton.onClick).AddListener(UnityAction.op_Implicit((Action)delegate
				{
					OnDeleteButtonClicked();
				}));
				((UnityEvent)deletePropsButton.onClick).AddListener(UnityAction.op_Implicit((Action)delegate
				{
					OnDeletePropsButtonClicked();
				}));
			}
		}

		public void UpdateInformation(Actor actor)
		{
			this.actor = actor;
			((TMP_Text)actorNameText).text = this.actor.ActorName;
		}

		public void OnDeleteButtonClicked()
		{
			actor.Delete();
			MDMenu.Instance.PreviousPage();
		}

		public void OnDeletePropsButtonClicked()
		{
			Director.ClearLastProps();
		}

		public void OnRecastButtonClicked()
		{
			Director.Recast(actor);
		}

		public void OnShowButtonClicked()
		{
			bool activeInHierarchy = ((Component)actor.ClonedAvatar).gameObject.activeInHierarchy;
			((TMP_Text)visiblityButtonText).text = (activeInHierarchy ? "Show" : "Hide");
			((Component)actor.ClonedAvatar).gameObject.SetActive(!activeInHierarchy);
		}
	}
	[RegisterTypeInIl2Cpp]
	public class ActorsPage : MonoBehaviour
	{
		private List<ActorDisplayPage> displayPages;

		private ActorDisplayPage currentDisplayPage;

		private MDMenu menu;

		private ActorSettingsPage settingsPage;

		private ActorEntry[] actorEntries;

		private Transform castListContainer;

		private bool initialized;

		private int pageIndex;

		public int PageIndex => pageIndex + 1;

		public int PageCount => displayPages.Count;

		public ActorsPage(IntPtr ptr)
			: base(ptr)
		{
		}

		private void Start()
		{
			Events.OnActorCasted = (Action<Actor>)Delegate.Combine(Events.OnActorCasted, new Action<Actor>(OnActorCreated));
			Events.OnActorUncasted = (Action<Actor>)Delegate.Combine(Events.OnActorUncasted, new Action<Actor>(OnActorRemoved));
		}

		public void Initialize(MDMenu menu)
		{
			if (initialized)
			{
				return;
			}
			this.menu = menu;
			castListContainer = ((Component)this).transform.GetChild(0);
			settingsPage = ((Component)((Component)this).transform.GetChild(1)).GetComponent<ActorSettingsPage>();
			actorEntries = new ActorEntry[castListContainer.childCount];
			for (int i = 0; i < actorEntries.Length; i++)
			{
				GameObject gameObject = ((Component)castListContainer.GetChild(i)).gameObject;
				ActorEntry entry = gameObject.AddComponent<ActorEntry>();
				entry.avatarImage = ((Component)gameObject.transform.GetChild(0)).GetComponent<RawImage>();
				entry.avatarNameText = ((Component)gameObject.transform.GetChild(1)).GetComponent<TextMeshProUGUI>();
				entry.avatarButton = gameObject.GetComponent<Button>();
				((UnityEvent)entry.avatarButton.onClick).AddListener(UnityAction.op_Implicit((Action)delegate
				{
					OnActorSelected(entry);
				}));
				actorEntries[i] = entry;
				gameObject.SetActive(false);
			}
			((Component)castListContainer).gameObject.SetActive(true);
			((Component)settingsPage).gameObject.SetActive(false);
			displayPages = new List<ActorDisplayPage>();
			currentDisplayPage = new ActorDisplayPage();
			currentDisplayPage.LinkToView(this);
			displayPages.Add(currentDisplayPage);
		}

		public void OnActorCreated(Actor actor)
		{
			ActorEntry first = GetFirst();
			UpdateEntry(actor, first);
			displayPages?.Last().AddActor(actor);
		}

		public void OnActorRemoved(Actor actor)
		{
			ActorEntry actorEntry = null;
			for (int i = 0; i < actorEntries.Length; i++)
			{
				if (((Component)actorEntries[i]).gameObject.activeSelf && actorEntries[i].GetActor() == actor)
				{
					actorEntry = actorEntries[i];
					break;
				}
			}
			if ((Object)(object)actorEntry == (Object)null)
			{
				Logging.Warn("Target actor entry not found! There might be a problem with the UI.");
			}
			else
			{
				actorEntry.Hide();
			}
		}

		public void OnPageFilled(Actor actor)
		{
			ActorDisplayPage actorDisplayPage = new ActorDisplayPage();
			actorDisplayPage.LinkToView(this);
			actorDisplayPage.AddActor(actor);
			displayPages.Add(actorDisplayPage);
		}

		public void PreviousPage()
		{
			if (pageIndex == 0)
			{
				pageIndex = 0;
				return;
			}
			ClearEntries();
			UpdatePage(displayPages[--pageIndex]);
		}

		public void NextPage()
		{
			if (pageIndex == displayPages.Count - 1)
			{
				pageIndex = displayPages.Count - 1;
				return;
			}
			ClearEntries();
			UpdatePage(displayPages[++pageIndex]);
		}

		public void GoBack()
		{
			((Component)settingsPage).gameObject.SetActive(false);
			((Component)castListContainer).gameObject.SetActive(true);
		}

		private void UpdatePage(ActorDisplayPage page)
		{
			currentDisplayPage = page;
			int count = currentDisplayPage.actorEntries.Count;
			for (int i = 0; i < count; i++)
			{
				UpdateEntry(currentDisplayPage.actorEntries[i], actorEntries[i]);
			}
		}

		private void OnActorSelected(ActorEntry entry)
		{
			((Component)castListContainer).gameObject.SetActive(false);
			settingsPage.UpdateInformation(entry.GetActor());
			menu.OpenPage("ActorSettings");
		}

		private void UpdateEntry(Actor actor, ActorEntry entry)
		{
			if (!((Object)(object)entry == (Object)null))
			{
				((TMP_Text)entry.avatarNameText).text = actor.ActorName;
				entry.SetActor(actor);
				((Component)entry).gameObject.SetActive(true);
			}
		}

		private void ClearEntries()
		{
			for (int i = 0; i < actorEntries.Length; i++)
			{
				((Component)actorEntries[i]).gameObject.SetActive(false);
			}
		}

		private ActorEntry GetFirst()
		{
			for (int i = 0; i < actorEntries.Length; i++)
			{
				if (!((Component)actorEntries[i]).gameObject.activeInHierarchy)
				{
					return actorEntries[i];
				}
			}
			return null;
		}
	}
	[RegisterTypeInIl2Cpp]
	public class MDFooter : MonoBehaviour
	{
		private Button previousPageButton;

		private Button nextPageButton;

		private Button goBackButton;

		private TextMeshProUGUI pageText;

		private ActorsPage actorsPage;

		public MDFooter(IntPtr ptr)
			: base(ptr)
		{
		}

		private void Awake()
		{
			previousPageButton = ((Component)((Component)this).transform.Find("PreviousPage")).GetComponent<Button>();
			nextPageButton = ((Component)((Component)this).transform.Find("NextPage")).GetComponent<Button>();
			goBackButton = ((Component)((Component)this).transform.Find("GoBack")).GetComponent<Button>();
			pageText = ((Component)((Component)this).transform.Find("PageText")).GetComponent<TextMeshProUGUI>();
		}

		public void LinkToActorView(ActorsPage actorsPage)
		{
			this.actorsPage = actorsPage;
			((UnityEvent)previousPageButton.onClick).AddListener(UnityAction.op_Implicit((Action)delegate
			{
				OnPreviousPageClicked();
			}));
			((UnityEvent)nextPageButton.onClick).AddListener(UnityAction.op_Implicit((Action)delegate
			{
				OnNextPageClicked();
			}));
			((UnityEvent)goBackButton.onClick).AddListener(UnityAction.op_Implicit((Action)delegate
			{
				OnGoBackClicked();
			}));
		}

		public void UnlinkToActorView()
		{
		}

		private void OnPreviousPageClicked()
		{
			actorsPage.PreviousPage();
			((TMP_Text)pageText).text = $"Page {actorsPage.PageIndex}/{actorsPage.PageCount}";
		}

		private void OnNextPageClicked()
		{
			actorsPage.NextPage();
			((TMP_Text)pageText).text = $"Page {actorsPage.PageIndex}/{actorsPage.PageCount}";
		}

		private void OnGoBackClicked()
		{
			actorsPage.GoBack();
		}
	}
	[RegisterTypeInIl2Cpp]
	public class MDMenu : MonoBehaviour
	{
		private GameObject page_Menu;

		private GameObject page_Playhead;

		private GameObject page_Actors;

		private GameObject page_Settings;

		private GameObject page_ActorPage;

		private MDFooter footer;

		private Transform contentContainer;

		private Transform pageContainer;

		private Grip grip;

		private Rigidbody rb;

		private string startingPage;

		private string currentPage;

		private string lastPage;

		public static MDMenu Instance { get; private set; }

		public MDMenu(IntPtr ptr)
			: base(ptr)
		{
		}

		private void Awake()
		{
			Instance = this;
			rb = ((Component)this).GetComponent<Rigidbody>();
			contentContainer = ((Component)this).transform.Find("Content");
			pageContainer = contentContainer.GetChild(0);
			Transform val = ((Component)this).transform.Find("Footer");
			Transform val2 = pageContainer.Find("Menu");
			Transform val3 = pageContainer.Find("Playhead");
			Transform val4 = pageContainer.Find("Actors");
			Transform val5 = pageContainer.Find("Settings");
			Transform val6 = val4.Find("ActorSettings");
			Transform val7 = ((Component)this).transform.Find("GripBall");
			page_Menu = ((val2 != null) ? ((Component)val2).gameObject : null);
			page_Playhead = ((val3 != null) ? ((Component)val3).gameObject : null);
			page_Actors = ((val4 != null) ? ((Component)val4).gameObject : null);
			page_Settings = ((val5 != null) ? ((Component)val5).gameObject : null);
			page_ActorPage = ((val6 != null) ? ((Component)val6).gameObject : null);
			GameObject obj = page_Menu;
			if (obj != null)
			{
				obj.AddComponent<MenuPage>().Initialize(this);
			}
			GameObject obj2 = page_Playhead;
			if (obj2 != null)
			{
				obj2.AddComponent<PlayheadPage>().Initialize();
			}
			GameObject obj3 = page_ActorPage;
			if (obj3 != null)
			{
				obj3.AddComponent<ActorSettingsPage>().Initialize(this);
			}
			GameObject obj4 = page_Actors;
			if (obj4 != null)
			{
				obj4.AddComponent<ActorsPage>().Initialize(this);
			}
			GameObject obj5 = page_Settings;
			if (obj5 != null)
			{
				obj5.AddComponent<SettingsPage>().Initialize(this);
			}
			footer = ((Component)val).gameObject.AddComponent<MDFooter>();
			startingPage = "Actors";
			footer.LinkToActorView(page_Actors.GetComponent<ActorsPage>());
			grip = ((Component)val7).GetComponent<Grip>();
			Grip obj6 = grip;
			obj6.attachedHandDelegate += HandDelegate.op_Implicit((Action<Hand>)delegate
			{
				rb.isKinematic = false;
			});
			Grip obj7 = grip;
			obj7.detachedHandDelegate += HandDelegate.op_Implicit((Action<Hand>)delegate
			{
				rb.isKinematic = true;
			});
		}

		private void OnEnable()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			((Component)this).transform.position = ((Rig)Player.PhysicsRig).m_chest.position + Vector3.forward;
			((Component)this).transform.LookAt(Player.Head);
			if (lastPage == null)
			{
				OpenPage(startingPage);
			}
			else
			{
				OpenPage(lastPage);
			}
		}

		public void OpenPage(string page)
		{
			lastPage = currentPage;
			switch (page)
			{
			case "Menu":
			{
				GameObject obj21 = page_Menu;
				if (obj21 != null)
				{
					obj21.SetActive(true);
				}
				GameObject obj22 = page_Playhead;
				if (obj22 != null)
				{
					obj22.SetActive(false);
				}
				GameObject obj23 = page_Actors;
				if (obj23 != null)
				{
					obj23.SetActive(false);
				}
				GameObject obj24 = page_ActorPage;
				if (obj24 != null)
				{
					obj24.SetActive(false);
				}
				GameObject obj25 = page_Settings;
				if (obj25 != null)
				{
					obj25.SetActive(false);
				}
				currentPage = page;
				break;
			}
			case "Playhead":
			{
				GameObject obj16 = page_Menu;
				if (obj16 != null)
				{
					obj16.SetActive(false);
				}
				GameObject obj17 = page_Playhead;
				if (obj17 != null)
				{
					obj17.SetActive(true);
				}
				GameObject obj18 = page_Actors;
				if (obj18 != null)
				{
					obj18.SetActive(false);
				}
				GameObject obj19 = page_ActorPage;
				if (obj19 != null)
				{
					obj19.SetActive(false);
				}
				GameObject obj20 = page_Settings;
				if (obj20 != null)
				{
					obj20.SetActive(false);
				}
				currentPage = page;
				break;
			}
			case "Actors":
			{
				GameObject obj6 = page_Menu;
				if (obj6 != null)
				{
					obj6.SetActive(false);
				}
				GameObject obj7 = page_Playhead;
				if (obj7 != null)
				{
					obj7.SetActive(false);
				}
				GameObject obj8 = page_Actors;
				if (obj8 != null)
				{
					obj8.SetActive(true);
				}
				GameObject obj9 = page_ActorPage;
				if (obj9 != null)
				{
					obj9.SetActive(false);
				}
				GameObject obj10 = page_Settings;
				if (obj10 != null)
				{
					obj10.SetActive(false);
				}
				currentPage = page;
				break;
			}
			case "Settings":
			{
				GameObject obj11 = page_Menu;
				if (obj11 != null)
				{
					obj11.SetActive(false);
				}
				GameObject obj12 = page_Playhead;
				if (obj12 != null)
				{
					obj12.SetActive(false);
				}
				GameObject obj13 = page_Actors;
				if (obj13 != null)
				{
					obj13.SetActive(false);
				}
				GameObject obj14 = page_ActorPage;
				if (obj14 != null)
				{
					obj14.SetActive(false);
				}
				GameObject obj15 = page_Settings;
				if (obj15 != null)
				{
					obj15.SetActive(true);
				}
				currentPage = page;
				break;
			}
			case "ActorSettings":
			{
				GameObject obj = page_Menu;
				if (obj != null)
				{
					obj.SetActive(false);
				}
				GameObject obj2 = page_Playhead;
				if (obj2 != null)
				{
					obj2.SetActive(false);
				}
				GameObject obj3 = page_Actors;
				if (obj3 != null)
				{
					obj3.SetActive(true);
				}
				GameObject obj4 = page_ActorPage;
				if (obj4 != null)
				{
					obj4.SetActive(true);
				}
				GameObject obj5 = page_Settings;
				if (obj5 != null)
				{
					obj5.SetActive(false);
				}
				break;
			}
			default:
				throw new Exception("Invalid page!");
			}
			MonoBehaviour.print(Object.op_Implicit(lastPage));
		}

		public void PreviousPage()
		{
			OpenPage(lastPage);
		}

		public void Hide()
		{
			((Component)this).gameObject.SetActive(false);
		}

		public void Show()
		{
			((Component)this).gameObject.SetActive(true);
		}
	}
	[RegisterTypeInIl2Cpp]
	public class MenuPage : MonoBehaviour
	{
		private MDMenu menu;

		private Button button_Playhead;

		private Button button_Actors;

		private Button button_Settings;

		private Button button_Exit;

		private bool initialized;

		public MenuPage(IntPtr ptr)
			: base(ptr)
		{
		}

		public void Initialize(MDMenu menu)
		{
			if (!initialized)
			{
				button_Playhead = ((Component)((Component)this).transform.GetChild(0)).GetComponent<Button>();
				button_Actors = ((Component)((Component)this).transform.GetChild(1)).GetComponent<Button>();
				button_Settings = ((Component)((Component)this).transform.GetChild(2)).GetComponent<Button>();
				button_Exit = ((Component)((Component)this).transform.GetChild(3)).GetComponent<Button>();
			}
		}

		public void SetRoot(MDMenu menu)
		{
			this.menu = menu;
		}
	}
	[RegisterTypeInIl2Cpp]
	public class PlayheadPage : MonoBehaviour
	{
		private Button button_Record;

		private Button button_Play;

		private Button button_Stop;

		private bool initialized;

		public PlayheadPage(IntPtr ptr)
			: base(ptr)
		{
		}

		public void Initialize()
		{
			if (!initialized)
			{
				button_Record = ((Component)((Component)this).transform.Find("Record")).GetComponent<Button>();
				button_Play = ((Component)((Component)this).transform.Find("Play")).GetComponent<Button>();
				button_Stop = ((Component)((Component)this).transform.Find("Stop")).GetComponent<Button>();
			}
		}

		public void DispatchRecord()
		{
		}

		public void DispatchPlay()
		{
		}

		public void DispatchStop()
		{
		}
	}
	[RegisterTypeInIl2Cpp]
	public class SettingsPage : MonoBehaviour
	{
		private MDMenu menu;

		private Button button_Audio;

		private Button button_Camera;

		private Button button_World;

		private Button button_Debug;

		private Button button_Credits;

		private GameObject page_Audio;

		private GameObject page_Camera;

		private GameObject page_Credits;

		private Transform optionsContainer;

		private Transform pageContainer;

		private bool initialized;

		public SettingsPage(IntPtr ptr)
			: base(ptr)
		{
		}

		public void Initialize(MDMenu menu)
		{
			if (!initialized)
			{
				optionsContainer = ((Component)this).transform.GetChild(0);
				pageContainer = ((Component)this).transform.GetChild(1);
				button_Audio = ((Component)optionsContainer.GetChild(0)).GetComponent<Button>();
				button_Camera = ((Component)optionsContainer.GetChild(1)).GetComponent<Button>();
				button_World = ((Component)optionsContainer.GetChild(2)).GetComponent<Button>();
				button_Debug = ((Component)optionsContainer.GetChild(3)).GetComponent<Button>();
				button_Credits = ((Component)optionsContainer.GetChild(4)).GetComponent<Button>();
				page_Audio = ((Component)pageContainer.GetChild(0)).gameObject;
				page_Camera = ((Component)pageContainer.GetChild(1)).gameObject;
				page_Credits = ((Component)pageContainer.GetChild(2)).gameObject;
				((Component)optionsContainer).gameObject.SetActive(true);
				((Component)pageContainer).gameObject.SetActive(false);
			}
		}

		public void OpenPage(string page)
		{
			switch (page)
			{
			case "Audio":
				page_Audio.SetActive(true);
				page_Camera.SetActive(false);
				page_Credits.SetActive(false);
				break;
			case "Camera":
				page_Audio.SetActive(false);
				page_Camera.SetActive(true);
				page_Credits.SetActive(false);
				break;
			case "Credits":
				page_Audio.SetActive(false);
				page_Camera.SetActive(false);
				page_Credits.SetActive(true);
				break;
			default:
				throw new Exception("Invalid options page!");
			}
			((Component)optionsContainer).gameObject.SetActive(false);
			((Component)pageContainer).gameObject.SetActive(true);
		}
	}
	internal static class MDBoneMenu
	{
		internal static Page rootCategory;

		internal static Page mdCategory;

		internal static Page playbackCategory;

		internal static Page actorCategory;

		internal static Page settingsCategory;

		internal static void Initialize()
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			rootCategory = Page.Root.CreatePage("Not Enough Photons", Color.white, 0, true);
			mdCategory = rootCategory.CreatePage("Mono<color=red>Director</color>", Color.white, 0, true);
			playbackCategory = mdCategory.CreatePage("Playback", Color.white, 0, true);
			actorCategory = mdCategory.CreatePage("Actors", Color.white, 0, true);
			settingsCategory = mdCategory.CreatePage("Settings", Color.white, 0, true);
			BuildPlaybackMenu(playbackCategory);
			BuildActorMenu(actorCategory);
			BuildSettingsMenu(settingsCategory);
		}

		private static void BuildPlaybackMenu(Page category)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			category.CreateFunction("Record", Color.red, (Action)delegate
			{
				Director.Record();
			});
			category.CreateFunction("Play", Color.green, (Action)delegate
			{
				Director.Play();
			});
			category.CreateFunction("Stop", Color.red, (Action)delegate
			{
				Director.Stop();
			});
		}

		private static void BuildActorMenu(Page category)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			category.CreateFunction("Remove All Actors", Color.red, (Action)delegate
			{
				//IL_0000: 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_000f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0010: Unknown result type (might be due to invalid IL or missing references)
				//IL_001a: Unknown result type (might be due to invalid IL or missing references)
				//IL_001f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0020: Unknown result type (might be due to invalid IL or missing references)
				//IL_0025: Unknown result type (might be due to invalid IL or missing references)
				//IL_004a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0055: Unknown result type (might be due to invalid IL or missing references)
				//IL_0056: Unknown result type (might be due to invalid IL or missing references)
				//IL_0057: Unknown result type (might be due to invalid IL or missing references)
				//IL_005c: Unknown result type (might be due to invalid IL or missing references)
				//IL_005d: Unknown result type (might be due to invalid IL or missing references)
				//IL_005e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0068: Expected O, but got Unknown
				Color primary2 = Color.red * 0.5f;
				Color secondary2 = Color.red * 0.1f;
				Menu.DisplayDialog(new DialogData
				{
					Confirm = delegate
					{
						Director.RemoveAllActors();
					},
					Message = "Are you sure? This cannot be undone.",
					Primary = primary2,
					Secondary = secondary2
				});
				Director.RemoveAllActors();
			});
			category.CreateFunction("Clear Scene", Color.red, (Action)delegate
			{
				//IL_0000: 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_000f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0010: Unknown result type (might be due to invalid IL or missing references)
				//IL_001a: Unknown result type (might be due to invalid IL or missing references)
				//IL_001f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0020: Unknown result type (might be due to invalid IL or missing references)
				//IL_0025: Unknown result type (might be due to invalid IL or missing references)
				//IL_004a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0055: Unknown result type (might be due to invalid IL or missing references)
				//IL_0056: Unknown result type (might be due to invalid IL or missing references)
				//IL_0057: Unknown result type (might be due to invalid IL or missing references)
				//IL_005c: Unknown result type (might be due to invalid IL or missing references)
				//IL_005d: Unknown result type (might be due to invalid IL or missing references)
				//IL_005e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0068: Expected O, but got Unknown
				Color primary = Color.red * 0.5f;
				Color secondary = Color.red * 0.1f;
				Menu.DisplayDialog(new DialogData
				{
					Confirm = delegate
					{
						Director.ClearScene();
					},
					Message = "Are you sure? This cannot be undone.",
					Primary = primary,
					Secondary = secondary
				});
			});
		}

		private static void BuildSettingsMenu(Page category)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: 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)
			Page val = category.CreatePage("Audio", Color.white, 0, true);
			if (!HelperMethods.IsAndroid())
			{
				BuildCameraCategory(category.CreatePage("Camera", Color.white, 0, true));
			}
			Page category2 = category.CreatePage("Tools", Color.white, 0, true);
			Page category3 = category.CreatePage("UI", Color.white, 0, true);
			val.CreateBool("Use Microphone", Color.white, false, (Action<bool>)delegate(bool value)
			{
				Settings.World.useMicrophone = value;
			});
			val.CreateBool("Mic Playback", Color.white, false, (Action<bool>)delegate(bool value)
			{
				Settings.World.micPlayback = value;
			});
			BuildToolCategory(category2);
			BuildUIMenu(category3);
		}

		private static void BuildCameraCategory(Page category)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: 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_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: 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_0120: Unknown result type (might be due to invalid IL or missing references)
			Page obj = category.CreatePage("Camera Modes", Color.white, 0, true);
			Page headModeCategory = category.CreatePage("Head Mode Settings", Color.white, 0, true);
			Page freeModeCategory = category.CreatePage("Free Camera Settings", Color.white, 0, true);
			obj.CreateFunction("Mode: None", Color.white, (Action)delegate
			{
				CameraRigManager.Instance.CameraMode = CameraMode.None;
			});
			obj.CreateFunction("Mode: Handheld", Color.white, (Action)delegate
			{
				CameraRigManager.Instance.CameraMode = CameraMode.Handheld;
			});
			obj.CreateFunction("Mode: Free", Color.white, (Action)delegate
			{
				CameraRigManager.Instance.CameraMode = CameraMode.Free;
			});
			obj.CreateFunction("Mode: Head", Color.white, (Action)delegate
			{
				CameraRigManager.Instance.CameraMode = CameraMode.Head;
			});
			BuildHeadModeCategory(headModeCategory);
			BuildFreeModeCategory(freeModeCategory);
			BuildVFXCategory(category.CreatePage("VFX", Color.white, 0, true));
			category.CreateBool("Kinematic On Release", Color.white, false, (Action<bool>)delegate(bool value)
			{
				Settings.Camera.handheldKinematicOnRelease = value;
			});
		}

		private static void BuildToolCategory(Page category)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: 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_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: 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)
			category.CreateFloat("Playback Speed", Color.white, 1f, 0.1f, float.NegativeInfinity, float.PositiveInfinity, (Action<float>)delegate(float value)
			{
				Playback.Instance.PlaybackRate = value;
			});
			category.CreateInt("Delay", Color.white, 5, 1, 0, 30, (Action<int>)delegate(int value)
			{
				Settings.World.delay = value;
			});
			category.CreateInt("FPS", Color.white, 60, 5, 5, 160, (Action<int>)delegate(int value)
			{
				Settings.World.fps = value;
			});
			category.CreateBool("Ignore Slomo", Color.white, false, (Action<bool>)delegate(bool value)
			{
				Settings.World.ignoreSlomo = value;
			});
			category.CreateBool("Temporal Scaling", Color.white, true, (Action<bool>)delegate(bool value)
			{
				Settings.World.temporalScaling = value;
			});
			category.CreateBool("Record Actors", Color.white, true, (Action<bool>)delegate(bool value)
			{
				Settings.World.recordActors = value;
			});
		}

		private static void BuildUIMenu(Page category)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			category.CreateBool("Show UI", Color.white, false, (Action<bool>)delegate(bool value)
			{
				InformationInterface.Instance.ShowUI = value;
			});
			category.CreateBool("Show Timecode", Color.white, false, (Action<bool>)delegate(bool value)
			{
				InformationInterface.Instance.ShowTimecode = value;
			});
			category.CreateBool("Show Play Mode", Color.white, false, (Action<bool>)delegate(bool value)
			{
				InformationInterface.Instance.ShowPlaymode = value;
			});
			category.CreateBool("Show Icons", Color.white, false, (Action<bool>)delegate(bool value)
			{
				InformationInterface.Instance.ShowIcons = value;
			});
		}

		private static void BuildHeadModeCategory(Page headModeCategory)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			headModeCategory.CreateFloat("Interpolation", Color.white, 4f, 1f, 0f, 64f, (Action<float>)delegate(float value)
			{
				CameraRigManager.Instance.CameraSmoothness = value;
			});
			headModeCategory.CreateEnum("Position", Color.white, (Enum)BodyPart.Head, (Action<Enum>)delegate(Enum bone)
			{
				CameraRigManager.Instance.FollowCamera.SetFollowBone((BodyPart)(object)bone);
			});
		}

		private static void BuildFreeModeCategory(Page freeModeCategory)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			freeModeCategory.CreateFloat("Mouse Sens.", Color.white, 1f, 0.5f, 0f, float.PositiveInfinity, (Action<float>)delegate(float value)
			{
				CameraRigManager.Instance.MouseSensitivity = value;
			});
			freeModeCategory.CreateFloat("Mouse Smoothing", Color.white, 1f, 0.5f, 0f, float.PositiveInfinity, (Action<float>)delegate(float value)
			{
				CameraRigManager.Instance.MouseSmoothness = value;
			});
			freeModeCategory.CreateFloat("Slow Speed", Color.white, 5f, 1f, 0f, float.PositiveInfinity, (Action<float>)delegate(float value)
			{
				CameraRigManager.Instance.SlowSpeed = value;
			});
			freeModeCategory.CreateFloat("Fast Speed", Color.white, 10f, 1f, 0f, float.PositiveInfinity, (Action<float>)delegate(float value)
			{
				CameraRigManager.Instance.FastSpeed = value;
			});
			freeModeCategory.CreateFloat("Max Speed", Color.white, 15f, 1f, 0f, float.PositiveInfinity, (Action<float>)delegate(float value)
			{
				CameraRigManager.Instance.MaxSpeed = value;
			});
			freeModeCategory.CreateFloat("Friction", Color.white, 5f, 1f, 0f, float.PositiveInfinity, (Action<float>)delegate(float value)
			{
				CameraRigManager.Instance.Friction = value;
			});
		}

		private static void BuildVFXCategory(Page vfxCategory)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			vfxCategory.CreateBool("Lens Distortion", Color.white, true, (Action<bool>)delegate(bool value)
			{
				CameraRigManager.Instance.EnableLensDistortion(value);
			});
			vfxCategory.CreateBool("Chromatic Abberation", Color.white, true, (Action<bool>)delegate(bool value)
			{
				CameraRigManager.Instance.EnableChromaticAbberation(value);
			});
		}
	}
	public static class PropMarkerManager
	{
		private static GameObject container;

		private static Dictionary<Prop, GameObject> markers = new Dictionary<Prop, GameObject>();

		private static List<GameObject> loadedMarkerObjects = new List<GameObject>();

		private static List<GameObject> activeMarkers = new List<GameObject>();

		public static void Initialize()
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Expected O, but got Unknown
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			markers = new Dictionary<Prop, GameObject>();
			loadedMarkerObjects = new List<GameObject>();
			activeMarkers = new List<GameObject>();
			container = new GameObject("[MonoDirector] - Prop Marker Container");
			container.transform.SetParent(Bootstrap.MainContainerObject.transform);
			for (int i = 0; i < 32; i++)
			{
				GameObject val = Object.Instantiate<GameObject>(BundleLoader.PropMarkerObject);
				val.SetActive(false);
				val.transform.SetParent(container.transform);
				val.transform.localPosition = Vector3.zero;
				loadedMarkerObjects.Add(val);
			}
			Events.OnPropCreated = (Action<Prop>)Delegate.Combine(Events.OnPropCreated, new Action<Prop>(AddMarkerToProp));
			Events.OnPropRemoved = (Action<Prop>)Delegate.Combine(Events.OnPropRemoved, new Action<Prop>(RemoveMarkerFromProp));
			Events.OnPlayStateSet = (Action<PlayState>)Delegate.Combine(Events.OnPlayStateSet, new Action<PlayState>(ShowMarkers));
		}

		public static void CleanUp()
		{
			Events.OnPropCreated = (Action<Prop>)Delegate.Remove(Events.OnPropCreated, new Action<Prop>(AddMarkerToProp));
			Events.OnPropRemoved = (Action<Prop>)Delegate.Remove(Events.OnPropRemoved, new Action<Prop>(RemoveMarkerFromProp));
			Events.OnPlayStateSet = (Action<PlayState>)Delegate.Remove(Events.OnPlayStateSet, new Action<PlayState>(ShowMarkers));
			markers.Clear();
			loadedMarkerObjects.Clear();
			activeMarkers.Clear();
		}

		public static void AddMarkerToProp(Prop prop)
		{
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			if (!markers.ContainsKey(prop))
			{
				GameObject val = ((IEnumerable<GameObject>)loadedMarkerObjects).FirstOrDefault((Func<GameObject, bool>)((GameObject marker) => !activeMarkers.Contains(marker)));
				if (Director.PlayState != PlayState.Recording)
				{
					val.gameObject.SetActive(true);
				}
				val.transform.SetParent(((Component)prop).transform);
				val.transform.localPosition = new Vector3(0f, 0.5f, 0f);
				markers.Add(prop, val);
				activeMarkers.Add(val);
			}
		}

		public static void RemoveMarkerFromProp(Prop prop)
		{
			if (markers.ContainsKey(prop))
			{
				GameObject val = markers[prop];
				val.gameObject.SetActive(false);
				val.transform.parent = null;
				markers.Remove(prop);
				activeMarkers.Remove(val.gameObject);
			}
		}

		private static void ShowMarkers(PlayState playState)
		{
			if (playState == PlayState.Preplaying || playState == PlayState.Prerecording)
			{
				foreach (GameObject activeMarker in activeMarkers)
				{
					activeMarker.gameObject.SetActive(false);
				}
			}
			if (playState != PlayState.Stopped)
			{
				return;
			}
			foreach (GameObject activeMarker2 in activeMarkers)
			{
				activeMarker2.gameObject.SetActive(true);
			}
		}
	}
}
namespace NEP.MonoDirector.State
{
	public enum BodyPart
	{
		Head,
		Chest,
		Pelvis,
		LeftHand,
		RightHand
	}
	public enum CameraMode
	{
		None,
		Free,
		Handheld,
		Head
	}
	public enum CaptureState
	{
		CaptureCamera,
		CaptureActor,
		None
	}
	public enum PlayState
	{
		Preplaying,
		Playing,
		Prerecording,
		Recording,
		Paused,
		Stopped
	}
}
namespace NEP.MonoDirector.Proxy
{
	[RegisterTypeInIl2Cpp]
	public class ActorProxy : TrackableProxy
	{
		private Actor m_actor;

		private BoxCollider m_triggerHull;

		private GameObject m_frame;

		public Actor Actor => m_actor;

		public BoxCollider Collider => m_triggerHull;

		public ActorProxy(IntPtr ptr)
			: base(ptr)
		{
		}

		private void Awake()
		{
			BuildHull();
		}

		private void BuildHull()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("Actor Trigger Hull");
			m_triggerHull = val.AddComponent<BoxCollider>();
			((Collider)m_triggerHull).isTrigger = true;
			val.transform.SetParent(((Component)this).transform);
			val.transform.localPosition = Vector3.up;
			val.transform.localRotation = Quaternion.identity;
			val.SetActive(false);
		}

		public void SetActor(Actor actor)
		{
			//IL_001c: 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)
			m_actor = actor;
			m_triggerHull.size = new Vector3(0.5f, 1f, 0.5f);
			((Component)m_triggerHull).transform.SetParent(m_actor.ClonedAvatar.animator.GetBoneTransform((HumanBodyBones)0));
			if ((Object)(object)m_frame == (Object)null)
			{
				m_frame = ActorFrameManager.AddFrameToActor(this);
			}
			else
			{
				m_frame.transform.localScale = m_triggerHull.size;
			}
		}

		public void OnSelected()
		{
			FeedbackSFX.LinkAudio();
			((Component)m_triggerHull).gameObject.SetActive(true);
			Director.SelectActor(m_actor);
		}

		public void OnDeselected()
		{
			((Component)m_triggerHull).gameObject.SetActive(false);
			Director.DeselectActor(m_actor);
		}
	}
	[RegisterTypeInIl2Cpp]
	public class TrackableProxy : MonoBehaviour
	{
		public TrackableProxy(IntPtr ptr)
			: base(ptr)
		{
		}
	}
}
namespace NEP.MonoDirector.Cameras
{
	[RegisterTypeInIl2Cpp]
	public class CameraDamp : MonoBehaviour
	{
		public float delta = 4f;

		private Quaternion m_lastRotation;

		public CameraDamp(IntPtr ptr)
			: base(ptr)
		{
		}

		private void LateUpdate()
		{
		}
	}
	[RegisterTypeInIl2Cpp]
	public class CameraDisplay : MonoBehaviour
	{
		private SmoothFollower m_smoothFollower;

		public FOVController FOVController { get; private set; }

		public FollowCamera FollowCamera { get; private set; }

		public CameraVolume CameraVolume { get; private set; }

		public CameraDisplay(IntPtr ptr)
			: base(ptr)
		{
		}

		private void Awake()
		{
			m_smoothFollower = ((Component)this).GetComponent<SmoothFollower>();
			((Behaviour)m_smoothFollower).enabled = false;
			FOVController = ((Component)this).gameObject.AddComponent<FOVController>();
			FollowCamera = ((Component)this).gameObject.AddComponent<FollowCamera>();
			CameraVolume = ((Component)this).gameObject.AddComponent<CameraVolume>();
			FOVController.SetCamera(((Component)this).GetComponent<Camera>());
		}

		private void Start()
		{
			FollowCamera.SetFollowTarget(m_smoothFollower.targetTransform);
		}
	}
	public class CameraRigManager
	{
		private GameObject m_cameraObject;

		private CameraMode m_cameraMode;

		public static CameraRigManager Instance { get; private set; }

		public RigScreenOptions RigScreenOptions { get; private set; }

		public Camera Camera { get; private set; }

		public Camera ClonedCamera { get; private set; }

		public InputController InputController { get; private set; }

		public FreeCamera FreeCamera { get; private set; }

		public FollowCamera FollowCamera { get; private set; }

		public FOVController FOVController { get; private set; }

		public CameraDamp CameraDamp { get; private set; }

		public CameraVolume[] CameraVolumes { get; private set; }

		public CameraDisplay CameraDisplay { get; private set; }

		public SmoothFollower SmoothFollower { get; private set; }

		public RenderTexture CameraDisplayTexture { get; private set; }

		public CameraMode CameraMode
		{
			get
			{
				return m_cameraMode;
			}
			set
			{
				m_cameraMode = value;
				if (m_cameraMode == CameraMode.None)
				{
					((Behaviour)FreeCamera).enabled = false;
					((Behaviour)CameraDamp).enabled = false;
					((Behaviour)FollowCamera).enabled = false;
					((Behaviour)SmoothFollower).enabled = true;
				}
				if (m_cameraMode == CameraMode.Free)
				{
					((Behaviour)SmoothFollower).enabled = false;
					((Behaviour)FreeCamera).enabled = true;
					((Behaviour)CameraDamp).enabled = false;
					((Behaviour)FollowCamera).enabled = false;
				}
				if (m_cameraMode == CameraMode.Head)
				{
					((Behaviour)SmoothFollower).enabled = false;
					((Behaviour)CameraDamp).enabled = false;
					((Behaviour)FollowCamera).enabled = true;
					((Behaviour)FreeCamera).enabled = false;
				}
				Events.OnCameraModeSet?.Invoke(m_cameraMode);
			}
		}

		public float CameraSmoothness
		{
			get
			{
				return FollowCamera.delta;
			}
			set
			{
				FollowCamera.delta = value;
			}
		}

		public float MouseSensitivity
		{
			get
			{
				return InputController.mouseSensitivity;
			}
			set
			{
				InputController.mouseSensitivity = value;
			}
		}

		public float MouseSmoothness
		{
			get
			{
				return InputController.mouseSmoothness;
			}
			set
			{
				InputController.mouseSmoothness = value;
			}
		}

		public float SlowSpeed
		{
			get
			{
				return FreeCamera.CameraSettings.slowSpeed;
			}
			set
			{
				FreeCamera.CameraSettings.slowSpeed = value;
			}
		}

		public float FastSpeed
		{
			get
			{
				return FreeCamera.CameraSettings.fastSpeed;
			}
			set
			{
				FreeCamera.CameraSettings.fastSpeed = value;
			}
		}

		public float MaxSpeed
		{
			get
			{
				return FreeCamera.CameraSettings.maxSpeed;
			}
			set
			{
				FreeCamera.CameraSettings.maxSpeed = value;
			}
		}

		public float Friction
		{
			get
			{
				return FreeCamera.CameraSettings.friction;
			}
			set
			{
				FreeCamera.CameraSettings.friction = value;
			}
		}

		public CameraRigManager(RigScreenOptions options)
		{
			RigScreenOptions = options;
			Start();
		}

		private void Start()
		{
			Instance = this;
			InitializeCamera(RigScreenOptions);
		}

		private void InitializeCamera(RigScreenOptions screenOptions)
		{
			Camera = screenOptions.cam;
			m_cameraObject = ((Component)Camera).gameObject;
			ClonedCamera = Object.Instantiate<GameObject>(m_cameraObject).GetComponent<Camera>();
			((Component)ClonedCamera).gameObject.SetActive(false);
			m_cameraObject.transform.parent = null;
			SmoothFollower = m_cameraObject.GetComponent<SmoothFollower>();
			InputController = m_cameraObject.AddComponent<InputController>();
			FreeCamera = m_cameraObject.AddComponent<FreeCamera>();
			FOVController = m_cameraObject.AddComponent<FOVController>();
			FollowCamera = m_cameraObject.AddComponent<FollowCamera>();
			CameraDamp = m_cameraObject.AddComponent<CameraDamp>();
			CameraVolumes = new CameraVolume[2]
			{
				m_cameraObject.AddComponent<CameraVolume>(),
				((Component)ClonedCamera).gameObject.AddComponent<CameraVolume>()
			};
			FOVController.SetCamera(Camera);
			CameraMode = CameraMode.None;
			FollowCamera.SetFollowTarget(SmoothFollower.targetTransform);
			CameraDisplay = ((Component)ClonedCamera).gameObject.AddComponent<CameraDisplay>();
		}

		public void EnableLensDistortion(bool enable)
		{
			CameraVolume[] cameraVolumes = CameraVolumes;
			for (int i = 0; i < cameraVolumes.Length; i++)
			{
				((VolumeComponent)cameraVolumes[i].LensDistortion).active = enable;
			}
		}

		public void EnableChromaticAbberation(bool enable)
		{
			CameraVolume[] cameraVolumes = CameraVolumes;
			for (int i = 0; i < cameraVolumes.Length; i++)
			{
				((VolumeComponent)cameraVolumes[i].ChromaticAberration).active = enable;
			}
		}
	}
	[RegisterTypeInIl2Cpp]
	public class CameraVolume : MonoBehaviour
	{
		public Volume RenderingVolume { get; private set; }

		public LensDistortion LensDistortion { get; private set; }

		public ChromaticAberration ChromaticAberration { get; private set; }

		public MKGlow MkGlow { get; private set; }

		public Vignette Vignette { get; private set; }

		public Bloom Bloom { get; private set; }

		public CameraVolume(IntPtr ptr)
			: base(ptr)
		{
		}

		private void Start()
		{
			RenderingVolume = ((Component)this).GetComponent<Volume>();
			LensDistortion = ((Il2CppObjectBase)RenderingVolume.profile.components[0]).Cast<LensDistortion>();
			ChromaticAberration = ((Il2CppObjectBase)RenderingVolume.profile.components[1]).Cast<ChromaticAberration>();
			MkGlow = ((Il2CppObjectBase)RenderingVolume.profile.components[4]).Cast<MKGlow>();
		}

		public void EnableAll(bool enabled)
		{
			Enumerator<VolumeComponent> enumerator = RenderingVolume.profile.components.GetEnumerator();
			while (enumerator.MoveNext())
			{
				enumerator.Current.SetAllOverridesTo(enabled);
			}
		}

		public void SetValue(FloatParameter parameter, float value)
		{
			if (parameter != null)
			{
				((VolumeParameter<float>)(object)parameter).value = value;
			}
		}
	}
	[RegisterTypeInIl2Cpp]
	public class FollowCamera : MonoBehaviour
	{
		public readonly Dictionary<BodyPart, BodyPartData> FollowPoints = new Dictionary<BodyPart, BodyPartData>();

		public float delta = 4f;

		private Vector3 m_positionOffset;

		private Vector3 m_rotationEulerOffset;

		private Transform m_followTarget;

		public Transform FollowTarget => m_followTarget;

		public FollowCamera(IntPtr ptr)
			: base(ptr)
		{
		}

		protected void Update()
		{
			//IL_001b: 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_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)m_followTarget == (Object)null))
			{
				((Component)this).transform.position = m_followTarget.position;
				((Component)this).transform.rotation = Quaternion.Slerp(((Component)this).transform.rotation, m_followTarget.rotation, delta * Time.deltaTime);
			}
		}

		public void SetDefaultTarget()
		{
			SetFollowTarget(FollowPoints[BodyPart.Head].transform);
		}

		public void SetFollowTarget(Transform target)
		{
			m_followTarget = target;
		}

		public void SetPositionOffset(Vector3 offset)
		{
			//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)
			m_positionOffset = offset;
		}

		public void SetRotationOffset(Vector3 offset)
		{
			//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)
			m_rotationEulerOffset = offset;
		}

		public void SetRotationOffset(Quaternion offset)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			m_rotationEulerOffset = ((Quaternion)(ref offset)).eulerAngles;
		}

		public void SetFollowBone(BodyPart part)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			m_positionOffset = Vector3.zero;
			m_rotationEulerOffset = Vector3.zero;
			Vector3 position = FollowPoints[part].position;
			m_followTarget.position = position;
			m_followTarget.localPosition = m_positionOffset;
			m_followTarget.localRotation = Quaternion.Euler(m_rotationEulerOffset);
		}
	}
	[RegisterTypeInIl2Cpp]
	public class FOVController : MonoBehaviour
	{
		public float fovChangeSmoothing = 10f;

		public float fovChangeRate = 4f;

		private Camera m_camera;

		private float m_fov = 90f;

		private float m_lastFOV;

		public FOVController(IntPtr ptr)
			: base(ptr)
		{
		}

		private void Update()
		{
			MouseFOV();
		}

		private void LateUpdate()
		{
			m_camera.fieldOfView = Mathf.Lerp(m_lastFOV, m_fov, fovChangeSmoothing * Time.deltaTime);
		}

		private void MouseFOV()
		{
			m_lastFOV = m_camera.fieldOfView;
			SetFOV(Input.GetAxisRaw("Mouse ScrollWheel") * fovChangeRate);
		}

		public void SetCamera(Camera camera)
		{
			m_camera = camera;
		}

		public void SetFOV(float fov)
		{
			m_fov -= fov;
		}
	}
	[RegisterTypeInIl2Cpp]
	public class FreeCamera : MonoBehaviour
	{
		public class Settings
		{
			public float slowSpeed;

			public float fastSpeed;

			public float maxSpeed;

			public float friction;

			public float fovChangeRate;

			public float fovChangeSmoothing;

			public float xShake;

			public float yShake;

			public float zShake;

			public float shakeMultiplier;
		}

		public Settings CameraSettings;

		private Vector3 m_shakeVector;

		private Vector3 m_wishDir = Vector3.zero;

		private float m_currentSpeed;

		private Rigidbody m_rigidbody;

		private InputController m_inputControl = CameraRigManager.Instance.InputController;

		private bool m_fastCamera => Input.GetKey((KeyCode)304);

		public FreeCamera(IntPtr ptr)
			: base(ptr)
		{
		}//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)


		protected void Awake()
		{
			m_rigidbody = ((Component)this).gameObject.AddComponent<Rigidbody>();
			m_rigidbody.useGravity = false;
			CameraSettings = new Settings
			{
				slowSpeed = 5f,
				fastSpeed = 10f,
				maxSpeed = 15f,
				friction = 5f,
				xShake = 0f,
				yShake = 0f,
				zShake = 0f,
				shakeMultiplier = 0f
			};
		}

		protected void Update()
		{
			MoveUpdate();
			MouseUpdate();
		}

		private void MouseUpdate()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: 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_00d2: 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_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_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = m_inputControl.MouseMove();
			float num = Mathf.Sin(Time.time) + Mathf.PerlinNoise(CameraSettings.xShake * Time.time, CameraSettings.yShake) * m_shakeVector.x;
			float num2 = Mathf.Sin(Time.time) + Mathf.PerlinNoise(CameraSettings.xShake, 1f - CameraSettings.yShake * Time.time) * m_shakeVector.y;
			float num3 = num2 * m_shakeVector.z;
			Vector3 val2 = Vector3.right * (val.y + num * CameraSettings.shakeMultiplier);
			Vector3 val3 = Vector3.up * (val.x + num2 * CameraSettings.shakeMultiplier);
			Vector3 val4 = Vector3.forward * (val.z + num3 * CameraSettings.shakeMultiplier);
			((Component)this).transform.rotation = Quaternion.Euler(val2 + val3 + val4);
		}

		private void MoveUpdate()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: 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_0072: 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_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_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = m_inputControl.KeyboardMove();
			Vector3.ClampMagnitude(m_wishDir, CameraSettings.maxSpeed);
			Transform transform = ((Component)CameraRigManager.Instance.Camera).transform;
			m_currentSpeed = (m_fastCamera ? CameraSettings.fastSpeed : CameraSettings.slowSpeed);
			val = Vector3.ClampMagnitude(val, CameraSettings.maxSpeed);
			m_wishDir = transform.right * val.x + transform.up * val.y + transform.forward * val.z;
			m_rigidbody.AddForce(m_wishDir * m_currentSpeed);
			m_rigidbody.drag = CameraSettings.friction;
		}
	}
	[RegisterTypeInIl2Cpp]
	public class HandheldCamera : MonoBehaviour
	{
		private CylinderGrip m_leftHandle;

		private CylinderGrip m_rightHandle;

		private Transform m_leftHandleTransform;

		private Transform m_rightHandleTransform;

		private Transform m_cameraPoint;

		private Camera m_camera;

		private Camera m_screenCamera;

		private GameObject m_frontScreen;

		private GameObject m_displayScreen;

		private Rigidbody m_rigidbody;

		private Quaternion m_lastFrameRotation;

		private Quaternion m_desiredRotation;

		private RenderTexture m_displayTexture => m_screenCamera.targetTexture;

		public HandheldCamera(IntPtr ptr)
			: base(ptr)
		{
		}

		private void Awake()
		{
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			m_leftHandleTransform = ((Component)this).transform.Find("Grips/Left Handle");
			m_rightHandleTransform = ((Component)this).transform.Find("Grips/Right Handle");
			m_camera = ((Component)((Component)this).transform.Find("Camera")).GetComponent<Camera>();
			m_screenCamera = ((Component)((Component)m_camera).transform.GetChild(0)).GetComponent<Camera>();
			m_frontScreen = ((Component)((Component)this).transform.Find("ExternalScreen")).gameObject;
			m_displayScreen = ((Component)((Component)this).transform.Find("Screen")).gameObject;
			m_cameraPoint = ((Component)this).transform.Find("CamPoint");
			m_leftHandle = ((Component)m_leftHandleTransform).GetComponent<CylinderGrip>();
			m_rightHandle = ((Component)m_rightHandleTransform).GetComponent<CylinderGrip>();
			m_rigidbody = ((Component)this).GetComponent<Rigidbody>();
			m_camera.backgroundColor = Color.black;
			m_screenCamera.backgroundColor = Color.black;
			m_camera.clearFlags = (CameraClearFlags)2;
			m_screenCamera.clearFlags = (CameraClearFlags)2;
		}

		private void OnEnable()
		{
			OnCameraModeChanged(CameraMode.Handheld);
			CylinderGrip leftHandle = m_leftHandle;
			((Grip)leftHandle).attachedUpdateDelegate = ((Grip)leftHandle).attachedUpdateDelegate + HandDelegate.op_Implicit((Action<Hand>)LeftHandUpdate);
			CylinderGrip rightHandle = m_rightHandle;
			((Grip)rightHandle).attachedUpdateDelegate = ((Grip)rightHandle).attachedUpdateDelegate + HandDelegate.op_Implicit((Action<Hand>)RightHandUpdate);
			CylinderGrip leftHandle2 = m_leftHandle;
			((Grip)leftHandle2).detachedHandDelegate = ((Grip)leftHandle2).detachedHandDelegate + HandDelegate.op_Implicit((Action<Hand>)LeftHandDetached);
			CylinderGrip leftHandle3 = m_leftHandle;
			((Grip)leftHandle3).detachedHandDelegate = ((Grip)leftHandle3).detachedHandDelegate + HandDelegate.op_Implicit((Action<Hand>)RightHandDetached);
			((Component)m_camera).transform.SetParent((Transform)null);
		}

		private void OnDisable()
		{
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			OnCameraModeChanged(CameraMode.Head);
			CylinderGrip leftHandle = m_leftHandle;
			((Grip)leftHandle).attachedUpdateDelegate = ((Grip)leftHandle).attachedUpdateDelegate - HandDelegate.op_Implicit((Action<Hand>)LeftHandUpdate);
			CylinderGrip rightHandle = m_rightHandle;
			((Grip)rightHandle).attachedUpdateDelegate = ((Grip)rightHandle).attachedUpdateDelegate - HandDelegate.op_Implicit((Action<Hand>)RightHandUpdate);
			CylinderGrip leftHandle2 = m_leftHandle;
			((Grip)leftHandle2).detachedHandDelegate = ((Grip)leftHandle2).detachedHandDelegate - HandDelegate.op_Implicit((Action<Hand>)LeftHandDetached);
			CylinderGrip leftHandle3 = m_leftHandle;
			((Grip)leftHandle3).detachedHandDelegate = ((Grip)leftHandle3).detachedHandDelegate - HandDelegate.op_Implicit((Action<Hand>)RightHandDetached);
			((Component)m_camera).transform.SetParent(((Component)this).transform);
			((Component)m_camera).transform.localPosition = m_cameraPoint.localPosition;
			((Component)m_camera).transform.localRotation = m_cameraPoint.localRotation;
		}

		private void Update()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			m_desiredRotation = m_cameraPoint.rotation;
		}

		private void LateUpdate()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: 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_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			((Component)m_camera).transform.position = m_cameraPoint.position;
			((Component)m_camera).transform.rotation = Quaternion.Slerp(m_lastFrameRotation, m_desiredRotation, 4f * Time.deltaTime);
			m_lastFrameRotation = ((Component)m_camera).transform.rotation;
		}

		private void OnCameraModeChanged(CameraMode mode)
		{
			if (mode == CameraMode.Handheld)
			{
				m_displayScreen.active = true;
				m_frontScreen.active = true;
				((Component)m_camera).gameObject.SetActive(true);
			}
			else
			{
				m_displayScreen.active = false;
				m_frontScreen.active = false;
				((Component)m_camera).gameObject.SetActive(false);
			}
		}

		private void LeftHandUpdate(Hand hand)
		{
			m_rigidbody.isKinematic = false;
			if (hand.GetIndexTriggerAxis() > 0.25f)
			{
				float num = 4f;
				Camera camera = m_camera;
				camera.fieldOfView += 0f - hand.GetIndexTriggerAxis() * num / 10f;
				Camera screenCamera = m_screenCamera;
				screenCamera.fieldOfView += 0f - hand.GetIndexTriggerAxis() * num / 10f;
			}
		}

		private void RightHandUpdate(Hand hand)
		{
			m_rigidbody.isKinematic = false;
			if (hand.GetIndexTriggerAxis() > 0.25f)
			{
				float num = 4f;
				Camera camera = m_camera;
				camera.fieldOfView += hand.GetIndexTriggerAxis() * num / 10f;
				Camera screenCamera = m_screenCamera;
				screenCamera.fieldOfView += hand.GetIndexTriggerAxis() * num / 10f;
			}
		}

		private void LeftHandDetached(Hand hand)
		{
			if (Settings.Camera.handheldKinematicOnRelease)
			{
				m_rigidbody.isKinematic = true;
			}
		}

		private void RightHandDetached(Hand hand)
		{
			if (Settings.Camera.handheldKinematicOnRelease)
			{
				m_rigidbody.isKinematic = true;
			}
		}
	}
	[RegisterTypeInIl2Cpp]
	public class InputController : MonoBehaviour
	{
		public float mouseSensitivity = 1f;

		public float mouseSmoothness = 4f;

		private Vector3 m_keyInput;

		private Vector3 m_mouseInput;

		private float m_xMouseMove;

		private float m_yMouseMove;

		private bool m_enableKeyboard = true;

		private bool m_enableMouse = true;

		private bool m_lockCursor;

		public InputController(IntPtr ptr)
			: base(ptr)
		{
		}

		private void Update()
		{
			m_lockCursor = Input.GetMouseButton(1);
			Cursor.lockState = (CursorLockMode)(m_lockCursor ? 1 : 0);
			Cursor.visible = !m_lockCursor;
		}

		public Vector3 KeyboardMove()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			if (!m_enableKeyboard)
			{
				return Vector3.zero;
			}
			int num = (Input.GetKey((KeyCode)113) ? (-1) : 0);
			int num2 = (Input.GetKey((KeyCode)101) ? 1 : 0);
			if (Input.GetKey((KeyCode)97))
			{
				m_keyInput.x = -1f;
			}
			else if (Input.GetKeyUp((KeyCode)97))
			{
				m_keyInput.x = 0f;
			}
			if (Input.GetKey((KeyCode)100))
			{
				m_keyInput.x = 1f;
			}
			else if (Input.GetKeyUp((KeyCode)100))
			{
				m_keyInput.x = 0f;
			}
			if (Input.GetKey((KeyCode)119))
			{
				m_keyInput.z = 1f;
			}
			else if (Input.GetKeyUp((KeyCode)119))
			{
				m_keyInput.z = 0f;
			}
			if (Input.GetKey((KeyCode)115))
			{
				m_keyInput.z = -1f;
			}
			else if (Input.GetKeyUp((KeyCode)115))
			{
				m_keyInput.z = 0f;
			}
			m_keyInput.y = num + num2;
			return m_keyInput;
		}

		public Vector3 MouseMove()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			if (!m_enableMouse)
			{
				return Vector3.zero;
			}
			if (m_xMouseMove > 0f || m_xMouseMove < 0f)
			{
				m_xMouseMove = Mathf.Lerp(m_xMouseMove, 0f, mouseSmoothness * Time.deltaTime);
			}
			if (m_yMouseMove > 0f || m_yMouseMove < 0f)
			{
				m_yMouseMove = Mathf.Lerp(m_yMouseMove, 0f, mouseSmoothness * Time.deltaTime);
			}
			if (!m_lockCursor)
			{
				return m_mouseInput;
			}
			float axisRaw = Input.GetAxisRaw("Mouse X");
			float axisRaw2 = Input.GetAxisRaw("Mouse Y");
			if (Input.GetKey((KeyCode)306) && Input.GetMouseButton(1))
			{
				m_mouseInput.z -= axisRaw;
			}
			m_xMouseMove += axisRaw * Time.deltaTime;
			m_yMouseMove += axisRaw2 * Time.deltaTime;
			m_mouseInput.x += m_xMouseMove * mouseSensitivity;
			m_mouseInput.y -= m_yMouseMove * mouseSensitivity;
			return m_mouseInput;
		}
	}
}
namespace NEP.MonoDirector.Tools
{
	[RegisterTypeInIl2Cpp]
	public class ActorPen : ToolEntity
	{
		private Transform m_rayPoint;

		private GameObject m_laserPointer;

		private ActorProxy m_selectedProxy;

		public ActorPen(IntPtr ptr)
			: base(ptr)
		{
		}

		protected override void Awake()
		{
			base.Awake();
			m_rayPoint = ((Component)this).transform.Find("RayPoint");
			m_laserPointer = ((Component)m_rayPoint.GetChild(0)).gameObject;
		}

		protected override void OnHandAttached(Hand hand)
		{
			m_laserPointer.SetActive(true);
		}

		protected override void OnHandDetached(Hand hand)
		{
			m_laserPointer.SetActive(false);
		}

		protected override void OnPrimaryButtonDown()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			RaycastHit val = default(RaycastHit);
			if (Physics.Raycast(new Ray(m_rayPoint.position, m_rayPoint.forward), ref val, float.PositiveInfinity, 1, (QueryTriggerInteraction)2))
			{
				if (!((Object)(object)((RaycastHit)(ref val)).collider.attachedRigidbody == (Object)null))
				{
					ActorProxy component = ((Component)((Component)((RaycastHit)(ref val)).collider.attachedRigidbody).GetComponent<MarrowBody>().Entity).GetComponent<ActorProxy>();
					if (!((Object)(object)component == (Object)null))
					{
						m_selectedProxy = component;
						m_selectedProxy.OnSelected();
					}
				}
			}
			else if ((Object)(object)m_selectedProxy != (Object)null)
			{
				m_selectedProxy.OnDeselected();
				m_selectedProxy = null;
			}
		}
	}
	[RegisterTypeInIl2Cpp]
	public class DirectedComponent : MonoBehaviour
	{
		public DirectedComponent(IntPtr ptr)
			: base(ptr)
		{
		}

		protected virtual void OnEnable()
		{
			Events.OnPlay = (Action)Delegate.Combine(Events.OnPlay, new Action(OnStartPlayback));
			Events.OnStopPlayback = (Action)Delegate.Combine(Events.OnStopPlayback, new Action(OnStopPlayback));
			Events.OnStartRecording = (Action)Delegate.Combine(Events.OnStartRecording, new Action(OnStartRecording));
			Events.OnStopRecording = (Action)Delegate.Combine(Events.OnStopRecording, new Action(OnStopRecording));
			Events.OnPlayStateSet = (Action<PlayState>)Delegate.Combine(Events.OnPlayStateSet, new Action<PlayState>(OnPlayStateSet));
		}

		protected virtual void OnDisable()
		{
			Events.OnPlay = (Action)Delegate.Remove(Events.OnPlay, new Action(OnStartPlayback));
			Events.OnStopPlayback = (Action)Delegate.Remove(Events.OnStopPlayback, new Action(OnStopPlayback));
			Events.OnStartRecording = (Action)Delegate.Remove(Events.OnStartRecording, new Action(OnStartRecording));
			Events.OnStopRecording = (Action)Delegate.Remove(Events.OnStopRecording, new Action(OnStopRecording));
			Events.OnPlayStateSet = (Action<PlayState>)Delegate.Remove(Events.OnPlayStateSet, new Action<PlayState>(OnPlayStateSet));
		}

		protected virtual void OnStartPlayback()
		{
		}

		protected virtual void OnStopPlayback()
		{
		}

		protected virtual void OnStartRecording()
		{
		}

		protected virtual void OnStopRecording()
		{
		}

		protected virtual void OnPlayStateSet(PlayState playState)
		{
		}
	}
	[RegisterTypeInIl2Cpp]
	public class LightAngleGizmo : ToolGizmo
	{
		private float m_angle = 90f;

		private TextMeshPro m_angleText;

		public float Angle => m_angle;

		public LightAngleGizmo(IntPtr ptr)
			: base(ptr)
		{
		}

		protected override void Awake()
		{
			base.Awake();
			m_angleText = ((Component)((Component)this).transform.Find("Text")).GetComponent<TextMeshPro>();
		}

		protected override void OnHandAttached(Hand hand)
		{
			m_body.isKinematic = false;
			m_joint.xMotion = (ConfigurableJointMotion)2;
		}

		protected override void OnHandDetached(Hand hand)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			((Joint)m_joint).connectedAnchor = ((Component)this).transform.localPosition;
			m_joint.targetPosition = ((Component)this).transform.localPosition;
			m_body.isKinematic = true;
			m_joint.xMotion = (ConfigurableJointMotion)1;
		}

		private void Update()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			m_angle = Vector3.Angle(((Component)this).transform.localPosition, Vector3.forward) * 2f;
			((TMP_Text)m_angleText).text = m_angle.ToString("0.00") + " deg";
		}

		public override void Hide()
		{
			base.Hide();
			((Component)m_angleText).gameObject.SetActive(false);
		}

		public override void Show()
		{
			base.Show();
			((Component)m_angleText).gameObject.SetActive(true);
		}
	}
	[RegisterTypeInIl2Cpp]
	public class LightColorGizmo : ToolGizmo
	{
		private Color m_color;

		private float m_sliderValue;

		private MeshRenderer m_meshRenderer;

		private Vector3 m_startPosition;

		private Vector3 m_maxPosition;

		private float m_sliderMax;

		private bool m_reset;

		public Color Color => m_color;

		public LightColorGizmo(IntPtr ptr)
			: base(ptr)
		{
		}

		protected override void Awake()
		{
			//IL_0024: 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_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)
			//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)
			base.Awake();
			m_sliderValue = 0f;
			m_meshRenderer = ((Component)this).GetComponentInChildren<MeshRenderer>();
			m_startPosition = ((Component)this).transform.localPosition;
			m_maxPosition = new Vector3(-0.158f, 0f, 0f);
			float x = m_startPosition.x;
			float x2 = m_maxPosition.x;
			m_sliderMax = Mathf.Sqrt(Mathf.Pow(x - x2, 2f));
			m_color = Color.white;
		}

		protected override void OnHandAttached(Hand hand)
		{
			m_body.isKinematic = false;
		}

		protected override void OnHandDetached(Hand hand)
		{
			m_body.isKinematic = true;
			m_reset = false;
		}

		protected override void OnHandAttachedUpdate(Hand hand)
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			base.OnHandAttachedUpdate(hand);
			if (!m_reset)
			{
				float x = ((Component)this).transform.localPosition.x;
				float x2 = m_maxPosition.x;
				float sliderValue = Mathf.Sqrt(Mathf.Pow(x - x2, 2f)) / m_sliderMax;
				m_sliderValue = sliderValue;
				m_sliderValue = Mathf.Max(0f, m_sliderValue);
				m_color = Color.HSVToRGB(m_sliderValue, 1f, 1f);
				((Renderer)m_meshRenderer).material.SetColor("_Emission", m_color);
				m_joint.targetPosition = ((Component)this).transform.localPosition;
			}
		}

		protected override void OnBButtonDown()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: 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)
			m_color = Color.white;
			((Renderer)m_meshRenderer).material.SetColor("_Emission", m_color);
			m_joint.targetPosition = m_startPosition;
			m_reset = true;
		}
	}
	[RegisterTypeInIl2Cpp]
	public class LightIntensityGizmo : ToolGizmo
	{
		private float m_intensity = 1f;

		private Vector3 m_lastUp;

		private TextMeshPro m_intensityText;

		private GameObject m_line;

		public float Intensity => m_intensity;

		public LightIntensityGizmo(IntPtr ptr)
			: base(ptr)
		{
		}

		protected override void Awake()
		{
			base.Awake();
			m_intensityText = ((Component)((Component)this).transform.Find("Text")).GetComponent<TextMeshPro>();
			m_line = ((Component)((Component)this).transform.Find("Line")).gameObject;
			m_body = ((Component)((Component)this).transform).GetComponentInParent<Rigidbody>();
		}

		private void Update()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: 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_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			Transform parent = ((Component)this).transform.parent;
			Vector3 val = parent.localRotation * Vector3.forward;
			Vector3 val2 = parent.localRotation * Vector3.up;
			float num = Vector3.SignedAngle(m_lastUp, val, val2);
			m_lastUp = val;
			m_intensity += num * 0.0027777778f;
			m_intensity = Mathf.Max(0f, m_intensity);
			((TMP_Text)m_intensityText).text = m_intensity.ToString("0.00");
		}

		public override void Hide()
		{
			base.Hide();
			((Component)m_intensityText).gameObject.SetActive(false);
			m_line.SetActive(false);
		}

		public override void Show()
		{
			base.Show();
			((Component)m_intensityText).gameObject.SetActive(true);
			m_line.SetActive(true);
		}
	}
	[RegisterTypeInIl2Cpp]
	public class LightRadiusGizmo : ToolGizmo
	{
		private float m_distance = 0.1f;

		private TextMeshPro m_distanceText;

		public float Distance => m_distance;

		public LightRadiusGizmo(IntPtr ptr)
			: base(ptr)
		{
		}

		protected override void Awake()
		{
			base.Awake();
			m_distanceText = ((Component)((Component)this).transform.Find("Text")).GetComponent<TextMeshPro>();
		}

		protected override void OnHandAttached(Hand hand)
		{
			m_body.isKinematic = false;
			m_joint.zMotion = (ConfigurableJointMotion)2;
		}

		protected override void OnHandDetached(Hand hand)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			((Joint)m_joint).connectedAnchor = ((Component)this).transform.localPosition;
			m_joint.targetPosition = ((Component)this).transform.localPosition;
			m_body.isKinematic = true;
			m_joint.zMotion = (ConfigurableJointMotion)1;
		}

		private void Update()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			float num = Vector3.Distance(((Component)this).