Decompiled source of MonoDirector v1.1.1
Install To Game Folder/Mods/MonoDirector.dll
Decompiled 7 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using AudioImportLib; using BoneLib; using BoneLib.BoneMenu; using BoneLib.BoneMenu.Elements; using BoneLib.Nullables; using HarmonyLib; using Il2CppSystem; using Il2CppSystem.Collections.Generic; using MK.Glow.URP; using MelonLoader; 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.Patches; using NEP.MonoDirector.State; using NEP.MonoDirector.UI; using SLZ.Bonelab; using SLZ.Combat; using SLZ.Data; using SLZ.Interaction; using SLZ.Marrow.Data; using SLZ.Marrow.Pool; using SLZ.Marrow.Warehouse; using SLZ.Props; using SLZ.Props.Weapons; using SLZ.Rig; using SLZ.SFX; using SLZ.VFX; using SLZ.VRMK; using SLZ.Vehicle; using TMPro; using UnhollowerBaseLib; using UnhollowerRuntimeLib; using Unity.Mathematics; using UnityEngine; using UnityEngine.Events; using UnityEngine.Rendering; using UnityEngine.Rendering.Universal; using UnityEngine.Splines; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("A movie/photo making utility for BONELAB!")] [assembly: AssemblyDescription("A movie/photo making utility for BONELAB!")] [assembly: AssemblyCompany(null)] [assembly: AssemblyProduct("MonoDirector")] [assembly: AssemblyCopyright("Developed by Not Enough Photons")] [assembly: AssemblyTrademark(null)] [assembly: AssemblyFileVersion("0.0.1")] [assembly: MelonInfo(typeof(Main), "MonoDirector", "0.0.1", "Not Enough Photons", null)] [assembly: MelonColor(ConsoleColor.DarkMagenta)] [assembly: MelonGame("Stress Level Zero", "BONELAB")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.1.0")] [module: UnverifiableCode] public static class Seat { [HarmonyPatch(typeof(Seat))] [HarmonyPatch("Register")] public static class Register { public static void Postfix(Seat __instance, RigManager rM) { Main.Logger.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() { Main.Logger.Msg("Deregister Rig"); Actor activeActor = Recorder.instance.ActiveActor; if (activeActor != null) { activeActor.RecordAction(delegate { activeActor.UnparentSeat(); }); } } } } namespace NEP.MonoDirector { public static class Constants { public static readonly string dirBase = Path.Combine(MelonUtils.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 static class BuildInfo { 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 = null; public const string Version = "0.0.1"; public const string DownloadLink = null; } public class Main : MelonMod { internal static Instance Logger; public static Main instance; public static Director director; public static FreeCamera camera; public static FeedbackSFX feedbackSFX; public static MDMenu mainMenu; public static AssetBundle bundle; public override void OnInitializeMelon() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown Logger = new Instance("MonoDirector", ConsoleColor.Magenta); instance = this; Directory.CreateDirectory(Constants.dirBase); Directory.CreateDirectory(Constants.dirMod); Directory.CreateDirectory(Constants.dirSFX); Directory.CreateDirectory(Constants.dirImg); bundle = GetEmbeddedBundle(); Hooking.OnLevelInitialized += delegate { MonoDirectorInitialize(); }; AssetWarehouse._onReady += Action.op_Implicit((Action)delegate { WarehouseLoader.GenerateSpawnablesFromSounds(WarehouseLoader.GetSounds().ToArray()); }); MDBoneMenu.Initialize(); } private void MonoDirectorInitialize() { ResetInstances(); CreateCameraManager(); CreateDirector(); CreateSFX(); CreateUI(); } private void ResetInstances() { Events.FlushActions(); director = null; camera = null; feedbackSFX = null; PropMarkerManager.CleanUp(); } private void CreateCameraManager() { new CameraRigManager(); } private void CreateDirector() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) director = new GameObject("MonoDirector - Director").AddComponent<Director>(); director.SetCamera(camera); } private void CreateSFX() { //IL_0005: 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) new GameObject("MonoDirector - Audio Manager").AddComponent<AudioManager>(); feedbackSFX = new GameObject("MonoDirector - Feedback SFX").AddComponent<FeedbackSFX>(); } private void CreateUI() { InfoInterfaceManager.Initialize(); WarehouseLoader.SpawnFromBarcode(WarehouseLoader.mainMenuBarcode); } private static AssetBundle GetEmbeddedBundle() { Assembly executingAssembly = Assembly.GetExecutingAssembly(); string text = "md_resources.pack"; using Stream stream = executingAssembly.GetManifestResourceStream("NEP.MonoDirector.Resources." + text); using MemoryStream memoryStream = new MemoryStream(); stream.CopyTo(memoryStream); return AssetBundle.LoadFromMemory(Il2CppStructArray<byte>.op_Implicit(memoryStream.ToArray())); } } public class Photographer { private Actor activeActor; private Actor 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) { lastActor = activeActor; activeActor = new Actor(avatar); } public void OnPrePhotograph() { } public void OnPhotograph() { } public void OnPostPhotograph() { } public IEnumerator PhotographRoutine() { Events.OnPrePhotograph?.Invoke(); for (int i = 0; i < Delay; i++) { Events.OnTimerCountdown?.Invoke(); yield return (object)new WaitForSeconds((float)Delay); } Events.OnPhotograph?.Invoke(); Events.OnPostPhotograph?.Invoke(); yield return null; } } 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 class Debug { public static bool debugEnabled = true; public static bool useKeys = true; } } } namespace NEP.MonoDirector.UI { 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.instance.ClearLastProps(); } public void OnRecastButtonClicked() { Director.instance.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) { Main.Logger.Warning("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.playerHead); 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 MenuCategory rootCategory; internal static MenuCategory mdCategory; internal static MenuCategory playbackCategory; internal static MenuCategory actorCategory; internal static MenuCategory settingsCategory; internal static void Initialize() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0050: 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) rootCategory = MenuManager.CreateCategory("Not Enough Photons", Color.white); mdCategory = rootCategory.CreateCategory("Mono<color=red>Director</color>", Color.white); playbackCategory = mdCategory.CreateCategory("Playback", Color.white); actorCategory = mdCategory.CreateCategory("Actors", Color.white); settingsCategory = mdCategory.CreateCategory("Settings", Color.white); BuildPlaybackMenu(playbackCategory); BuildActorMenu(actorCategory); BuildSettingsMenu(settingsCategory); } private static void BuildPlaybackMenu(MenuCategory 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.CreateFunctionElement("Record", Color.red, (Action)delegate { Director.instance.Record(); }); category.CreateFunctionElement("Play", Color.green, (Action)delegate { Director.instance.Play(); }); category.CreateFunctionElement("Stop", Color.red, (Action)delegate { Director.instance.Stop(); }); } private static void BuildActorMenu(MenuCategory 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_006b: Unknown result type (might be due to invalid IL or missing references) category.CreateFunctionElement("Show Caster Menu", Color.white, (Action)delegate { ((Component)MDMenu.instance).gameObject.SetActive(true); }); category.CreateFunctionElement("Remove All Actors", Color.red, (Action)delegate { Director.instance.RemoveAllActors(); }, "Are you sure? This cannot be undone."); category.CreateFunctionElement("Clear Scene", Color.red, (Action)delegate { Director.instance.ClearScene(); }, "Are you sure? This cannot be undone."); } private static void BuildSettingsMenu(MenuCategory category) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_006c: 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_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) MenuCategory val = category.CreateCategory("Audio", Color.white); MenuCategory obj = category.CreateCategory("Camera", Color.white); MenuCategory category2 = category.CreateCategory("Tools", Color.white); MenuCategory category3 = category.CreateCategory("UI", Color.white); MenuCategory headModeCategory = obj.CreateCategory("Head Mode Settings", Color.white); MenuCategory freeModeCategory = obj.CreateCategory("Free Camera Settings", Color.white); MenuCategory vfxCategory = obj.CreateCategory("VFX", Color.white); val.CreateBoolElement("Use Microphone", Color.white, false, (Action<bool>)delegate(bool value) { Settings.World.useMicrophone = value; }); val.CreateBoolElement("Mic Playback", Color.white, false, (Action<bool>)delegate(bool value) { Settings.World.micPlayback = value; }); obj.CreateEnumElement<CameraMode>("Camera Mode", Color.white, CameraMode.None, (Action<CameraMode>)delegate(CameraMode mode) { CameraRigManager.Instance.CameraMode = mode; }); obj.CreateBoolElement("Kinematic On Release", Color.white, false, (Action<bool>)delegate(bool value) { Settings.Camera.handheldKinematicOnRelease = value; }); BuildHeadModeCategory(headModeCategory); BuildFreeModeCategory(freeModeCategory); BuildVFXCategory(vfxCategory); BuildToolCategory(category2); BuildUIMenu(category3); } private static void BuildToolCategory(MenuCategory 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) category.CreateFloatElement("Playback Speed", Color.white, 1f, 0.1f, float.NegativeInfinity, float.PositiveInfinity, (Action<float>)delegate(float value) { Playback.Instance.PlaybackRate = value; }); category.CreateIntElement("Delay", Color.white, 5, 1, 0, 30, (Action<int>)delegate(int value) { Settings.World.delay = value; }); category.CreateIntElement("FPS", Color.white, 60, 5, 5, 160, (Action<int>)delegate(int value) { Settings.World.fps = value; }); category.CreateBoolElement("Ignore Slomo", Color.white, false, (Action<bool>)delegate(bool value) { Settings.World.ignoreSlomo = value; }); category.CreateBoolElement("Temporal Scaling", Color.white, true, (Action<bool>)delegate(bool value) { Settings.World.temporalScaling = value; }); } private static void BuildUIMenu(MenuCategory 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.CreateBoolElement("Show UI", Color.white, false, (Action<bool>)delegate(bool value) { InformationInterface.Instance.ShowUI = value; }); category.CreateBoolElement("Show Timecode", Color.white, false, (Action<bool>)delegate(bool value) { InformationInterface.Instance.ShowTimecode = value; }); category.CreateBoolElement("Show Play Mode", Color.white, false, (Action<bool>)delegate(bool value) { InformationInterface.Instance.ShowPlaymode = value; }); category.CreateBoolElement("Show Icons", Color.white, false, (Action<bool>)delegate(bool value) { InformationInterface.Instance.ShowIcons = value; }); } private static void BuildHeadModeCategory(MenuCategory 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.CreateFloatElement("Interpolation", Color.white, 4f, 1f, 0f, 64f, (Action<float>)delegate(float value) { CameraRigManager.Instance.CameraSmoothness = value; }); headModeCategory.CreateEnumElement<BodyPart>("Position", Color.white, BodyPart.Head, (Action<BodyPart>)delegate(BodyPart bone) { CameraRigManager.Instance.FollowCamera.SetFollowBone(bone); }); } private static void BuildFreeModeCategory(MenuCategory 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.CreateFloatElement("Mouse Sens.", Color.white, 1f, 0.5f, 0f, float.PositiveInfinity, (Action<float>)delegate(float value) { CameraRigManager.Instance.MouseSensitivity = value; }); freeModeCategory.CreateFloatElement("Mouse Smoothing", Color.white, 1f, 0.5f, 0f, float.PositiveInfinity, (Action<float>)delegate(float value) { CameraRigManager.Instance.MouseSmoothness = value; }); freeModeCategory.CreateFloatElement("Slow Speed", Color.white, 5f, 1f, 0f, float.PositiveInfinity, (Action<float>)delegate(float value) { CameraRigManager.Instance.SlowSpeed = value; }); freeModeCategory.CreateFloatElement("Fast Speed", Color.white, 10f, 1f, 0f, float.PositiveInfinity, (Action<float>)delegate(float value) { CameraRigManager.Instance.FastSpeed = value; }); freeModeCategory.CreateFloatElement("Max Speed", Color.white, 15f, 1f, 0f, float.PositiveInfinity, (Action<float>)delegate(float value) { CameraRigManager.Instance.MaxSpeed = value; }); freeModeCategory.CreateFloatElement("Friction", Color.white, 5f, 1f, 0f, float.PositiveInfinity, (Action<float>)delegate(float value) { CameraRigManager.Instance.Friction = value; }); } private static void BuildVFXCategory(MenuCategory 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.CreateBoolElement("Lens Distortion", Color.white, true, (Action<bool>)delegate(bool value) { CameraRigManager.Instance.EnableLensDistortion(value); }); vfxCategory.CreateBoolElement("Chromatic Abberation", Color.white, true, (Action<bool>)delegate(bool value) { CameraRigManager.Instance.EnableChromaticAbberation(value); }); } } public static class PropMarkerManager { 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() { loadedMarkerObjects = WarehouseLoader.SpawnFromBarcode(WarehouseLoader.propMarkerBarcode, 32); 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_006a: 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))); val.gameObject.SetActive(true); val.transform.SetParent(((Component)prop).transform); val.transform.localPosition = new Vector3(0f, 1.25f, 0f); markers.Add(prop, val); activeMarkers.Add(val); } } public static void RemoveMarkerFromProp(Prop prop) { if (markers.ContainsKey(prop)) { AssetPoolee component = markers[prop].GetComponent<AssetPoolee>(); component.Despawn(); ((Component)component).gameObject.SetActive(false); ((Component)component).transform.parent = null; markers.Remove(prop); activeMarkers.Remove(((Component)component).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); } } } [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_001f: 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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) micOffObject.SetActive(!Settings.World.useMicrophone); ((Component)this).transform.position = Vector3.Lerp(((Component)this).transform.position, Player.playerHead.position + Player.playerHead.forward, 16f * Time.deltaTime); ((Component)this).transform.LookAt(Player.playerHead); } 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 static class InfoInterfaceManager { public static void Initialize() { WarehouseLoader.SpawnFromBarcode(WarehouseLoader.infoInterfaceBarcode); } } } namespace NEP.MonoDirector.Tools { [RegisterTypeInIl2Cpp] public class OmniLight : MonoBehaviour { private Rigidbody rb; private GameObject sprite; private Grip lightGrip; public static List<OmniLight> ComponentCache { get; private set; } public float Range { get; private set; } public float Intensity { get; private set; } public OmniLight(IntPtr ptr) : base(ptr) { } private void Awake() { ComponentCache = new List<OmniLight>(); rb = ((Component)this).GetComponent<Rigidbody>(); sprite = ((Component)((Component)this).transform.Find("Sprite")).gameObject; lightGrip = ((Component)((Component)this).transform.Find("Grip")).GetComponent<Grip>(); Grip obj = lightGrip; obj.attachedHandDelegate += HandDelegate.op_Implicit((Action<Hand>)delegate(Hand hand) { AttachedHand(hand); }); Grip obj2 = lightGrip; obj2.detachedHandDelegate += HandDelegate.op_Implicit((Action<Hand>)delegate(Hand hand) { DetachedHand(hand); }); } private void OnEnable() { Events.OnPlayStateSet = (Action<PlayState>)Delegate.Combine(Events.OnPlayStateSet, new Action<PlayState>(OnPlayStateSet)); ComponentCache.Add(this); } private void OnDisable() { Events.OnPlayStateSet = (Action<PlayState>)Delegate.Remove(Events.OnPlayStateSet, new Action<PlayState>(OnPlayStateSet)); ComponentCache.Remove(this); } private void AttachedHand(Hand hand) { rb.isKinematic = false; } private void DetachedHand(Hand hand) { rb.isKinematic = true; } private void ShowVisuals() { sprite.SetActive(true); } private void HideVisuals() { sprite.SetActive(false); } private void OnPlayStateSet(PlayState playState) { if (playState == PlayState.Preplaying || playState == PlayState.Playing || playState == PlayState.Stopped) { HideVisuals(); } else { ShowVisuals(); } } } [RegisterTypeInIl2Cpp] public class Propifier : MonoBehaviour { public enum Mode { Prop, Remove } public Mode mode; public TargetGrip triggerGrip; public Transform firePoint; public float maxRange; public GameObject laserPointer; public Rigidbody rigidbody; public GameObject propModeIcon; public GameObject removeModeIcon; public float fireForce = 5f; private GunSFX gunSFX; public Propifier(IntPtr ptr) : base(ptr) { } private void Awake() { gunSFX = ((Component)this).GetComponent<GunSFX>(); triggerGrip = ((Component)((Component)this).transform.Find("Grips/HandlePrimaryGrip")).GetComponent<TargetGrip>(); firePoint = ((Component)this).transform.Find("PointOfInterest/FirePoint"); laserPointer = ((Component)((Component)this).transform.Find("Propifier Art/Laser")).gameObject; maxRange = 30f; propModeIcon = ((Component)((Component)this).transform.Find("Propifier Art/ScreenMode_Prop")).gameObject; removeModeIcon = ((Component)((Component)this).transform.Find("Propifier Art/ScreenMode_Remove")).gameObject; } private void Start() { TargetGrip obj = triggerGrip; ((Grip)obj).attachedHandDelegate = ((Grip)obj).attachedHandDelegate + HandDelegate.op_Implicit((Action<Hand>)delegate { OnAttachHand(); }); TargetGrip obj2 = triggerGrip; ((Grip)obj2).detachedHandDelegate = ((Grip)obj2).detachedHandDelegate + HandDelegate.op_Implicit((Action<Hand>)delegate { OnDetachHand(); }); TargetGrip obj3 = triggerGrip; ((Grip)obj3).attachedUpdateDelegate = ((Grip)obj3).attachedUpdateDelegate + HandDelegate.op_Implicit((Action<Hand>)delegate { OnTriggerGripUpdate(); }); } private void PrimaryButtonDown() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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_0048: 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_005e: Unknown result type (might be due to invalid IL or missing references) gunSFX.GunShot(); rigidbody.AddForce(((Component)rigidbody).transform.up - firePoint.forward * fireForce, (ForceMode)1); RaycastHit val = default(RaycastHit); if (!Physics.Raycast(firePoint.position, firePoint.forward * maxRange, ref val) || (Object)(object)((RaycastHit)(ref val)).rigidbody == (Object)null) { return; } InteractableHost component = ((Component)((RaycastHit)(ref val)).rigidbody).GetComponent<InteractableHost>(); if (!((Object)(object)component == (Object)null)) { if (mode == Mode.Prop) { PropBuilder.BuildProp(component); } else { PropBuilder.RemoveProp(component); } } } public void OnAttachHand() { rigidbody = ((Component)this).GetComponent<Rigidbody>(); laserPointer.SetActive(true); } public void OnDetachHand() { rigidbody = ((Component)this).GetComponent<Rigidbody>(); laserPointer.SetActive(false); } public void OnTriggerGripUpdate() { Hand hand = ((Grip)triggerGrip).GetHand(); if (hand.Controller.GetMenuTap()) { if (mode == Mode.Prop) { SetMode(Mode.Remove); } else { SetMode(Mode.Prop); } } if (hand._indexButtonDown) { PrimaryButtonDown(); } } public void SetMode(Mode mode) { this.mode = mode; gunSFX.DryFire(); switch (mode) { case Mode.Prop: propModeIcon.SetActive(true); removeModeIcon.SetActive(false); break; case Mode.Remove: propModeIcon.SetActive(false); removeModeIcon.SetActive(true); break; } } } [RegisterTypeInIl2Cpp] public class SpotLight : MonoBehaviour { private Rigidbody rb; private GameObject sprite; private Grip lightGrip; private GameObject arrow; public static List<SpotLight> ComponentCache { get; private set; } public float Range { get; private set; } public float Intensity { get; private set; } public SpotLight(IntPtr ptr) : base(ptr) { } private void Awake() { ComponentCache = new List<SpotLight>(); rb = ((Component)this).GetComponent<Rigidbody>(); sprite = ((Component)((Component)this).transform.Find("Sprite")).gameObject; lightGrip = ((Component)((Component)this).transform.Find("Grip")).GetComponent<Grip>(); arrow = ((Component)((Component)this).transform.Find("arrow")).gameObject; Grip obj = lightGrip; obj.attachedHandDelegate += HandDelegate.op_Implicit((Action<Hand>)delegate(Hand hand) { AttachedHand(hand); }); Grip obj2 = lightGrip; obj2.detachedHandDelegate += HandDelegate.op_Implicit((Action<Hand>)delegate(Hand hand) { DetachedHand(hand); }); } private void OnEnable() { Events.OnPlayStateSet = (Action<PlayState>)Delegate.Combine(Events.OnPlayStateSet, new Action<PlayState>(OnPlayStateSet)); ComponentCache.Add(this); } private void OnDisable() { Events.OnPlayStateSet = (Action<PlayState>)Delegate.Remove(Events.OnPlayStateSet, new Action<PlayState>(OnPlayStateSet)); ComponentCache.Remove(this); } private void AttachedHand(Hand hand) { rb.isKinematic = false; } private void DetachedHand(Hand hand) { rb.isKinematic = true; } private void ShowVisuals() { sprite.SetActive(true); arrow.SetActive(true); } private void HideVisuals() { sprite.SetActive(false); arrow.SetActive(false); } private void OnPlayStateSet(PlayState playState) { if (playState == PlayState.Preplaying || playState == PlayState.Playing || playState == PlayState.Stopped) { HideVisuals(); } else { ShowVisuals(); } } } [RegisterTypeInIl2Cpp] public class StudioLight : MonoBehaviour { private Color[] colors = (Color[])(object)new Color[8] { Color.white, Color.red, new Color(1f, 0.6470588f, 0f, 1f), Color.yellow, Color.green, Color.blue, new Color(0.2941177f, 0f, 0.509804f, 1f), new Color(0.9333333f, 0.509804f, 0.9333333f, 1f) }; private float[] intensities = new float[5] { 1f, 2f, 3f, 4f, 5f }; private Light spotlight; private Light pointLight; private CylinderGrip grip; private int colorIndex; private int intensityIndex; public StudioLight(IntPtr ptr) : base(ptr) { }//IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0041: 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_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0059: 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_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0099: 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) private void Awake() { spotlight = ((Component)((Component)this).transform.Find("Spotlight")).GetComponent<Light>(); pointLight = ((Component)((Component)this).transform.Find("Point Light")).GetComponent<Light>(); grip = ((Component)((Component)this).transform.Find("Grip")).GetComponent<CylinderGrip>(); CylinderGrip obj = grip; ((Grip)obj).attachedUpdateDelegate = ((Grip)obj).attachedUpdateDelegate + HandDelegate.op_Implicit((Action<Hand>)delegate(Hand hand) { HandAttachedUpdate(hand); }); } private void HandAttachedUpdate(Hand hand) { //IL_0041: 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) if (hand.GetIndexButtonDown()) { if (colorIndex > colors.Length) { colorIndex = 0; } else { colorIndex++; } spotlight.color = colors[colorIndex]; pointLight.color = colors[colorIndex]; } if (hand.Controller.GetMenuTap()) { if (intensityIndex > colors.Length) { intensityIndex = 0; } else { intensityIndex++; } spotlight.intensity = intensities[intensityIndex]; pointLight.intensity = intensities[intensityIndex]; } } } } 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.Core { [RegisterTypeInIl2Cpp] public class Director : MonoBehaviour { public Playback playback; public Recorder recorder; public List<Actor> Cast; public List<ActorNPC> NPCCast; public List<Prop> WorldProps; public List<Prop> RecordingProps; public List<Prop> LastRecordedProps; private static PlayState playState = PlayState.Stopped; private static PlayState lastPlayState; private static CaptureState captureState = CaptureState.CaptureActor; private FreeCamera camera; private int worldTick; public static Director instance { get; private set; } public FreeCamera Camera => camera; public CameraVolume Volume => ((Component)camera).GetComponent<CameraVolume>(); public static PlayState PlayState => playState; public static PlayState LastPlayState => lastPlayState; public static CaptureState CaptureState => captureState; public int WorldTick => worldTick; public Director(IntPtr ptr) : base(ptr) { } private void Awake() { instance = this; playback = new Playback(); recorder = new Recorder(); Cast = new List<Actor>(); NPCCast = new List<ActorNPC>(); WorldProps = new List<Prop>(); RecordingProps = new List<Prop>(); } private void Start() { Events.OnPrePlayback = (Action)Delegate.Combine(Events.OnPrePlayback, (Action)delegate { SetPlayState(PlayState.Preplaying); }); Events.OnPreRecord = (Action)Delegate.Combine(Events.OnPreRecord, (Action)delegate { SetPlayState(PlayState.Prerecording); }); Events.OnPlay = (Action)Delegate.Combine(Events.OnPlay, (Action)delegate { SetPlayState(PlayState.Playing); }); Events.OnStartRecording = (Action)Delegate.Combine(Events.OnStartRecording, (Action)delegate { SetPlayState(PlayState.Recording); }); } private void Update() { if (Settings.Debug.useKeys) { float num = Playback.Instance.PlaybackRate * Time.deltaTime; if (Input.GetKey((KeyCode)276)) { Playback.Instance.Seek(0f - num); } if (Input.GetKey((KeyCode)275)) { Playback.Instance.Seek(num); } if (Input.GetKeyDown((KeyCode)112)) { Play(); } if (Input.GetKeyDown((KeyCode)305)) { Record(); } if (Input.GetKeyDown((KeyCode)306)) { Stop(); } } } public void Play() { playback.BeginPlayback(); } public void Pause() { SetPlayState(PlayState.Paused); } public void Record() { recorder.StartRecordRoutine(); } public void Recast(Actor actor) { //IL_0017: 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_0022: Unknown result type (might be due to invalid IL or missing references) Vector3 position = actor.Frames[0].TransformFrames[0].position; Player.rigManager.Teleport(position, true); Player.rigManager.SwapAvatar(actor.ClonedAvatar); if (WorldProps.Count != 0) { foreach (Prop worldProp in WorldProps) { if (worldProp.Actor == actor) { Object.Destroy((Object)(object)worldProp); } } } Cast.Remove(actor); actor.Delete(); Record(); } public void Stop() { SetPlayState(PlayState.Stopped); } public void SetCamera(FreeCamera camera) { this.camera = camera; } public void RemoveActor(Actor actor) { Cast.Remove(actor); actor.Delete(); } public void RemoveLastActor() { RemoveActor(Recorder.instance.LastActor); foreach (Prop lastRecordedProp in LastRecordedProps) { WorldProps.Remove(lastRecordedProp); lastRecordedProp.InteractableRigidbody.isKinematic = false; Object.Destroy((Object)(object)lastRecordedProp); } } public void RemoveAllActors() { playState = PlayState.Stopped; for (int i = 0; i < Cast.Count; i++) { Cast[i].Delete(); } Cast.Clear(); } public void ClearLastProps() { foreach (Prop lastRecordedProp in LastRecordedProps) { lastRecordedProp.InteractableRigidbody.isKinematic = false; WorldProps.Remove(lastRecordedProp); Object.Destroy((Object)(object)lastRecordedProp); } LastRecordedProps.Clear(); } public void ClearScene() { RemoveAllActors(); foreach (Prop worldProp in WorldProps) { worldProp.InteractableRigidbody.isKinematic = false; Object.Destroy((Object)(object)worldProp); } WorldProps.Clear(); } public void SetPlayState(PlayState state) { lastPlayState = playState; playState = state; Events.OnPlayStateSet?.Invoke(state); } } public class Playback { public static Playback Instance; private float playbackTime; public float PlaybackRate = 1f; private Coroutine playRoutine; public float PlaybackTime => playbackTime; public int Countdown { get; private set; } public Playback() { Instance = this; Events.OnPrePlayback = (Action)Delegate.Combine(Events.OnPrePlayback, new Action(OnPrePlayback)); Events.OnPlay = (Action)Delegate.Combine(Events.OnPlay, new Action(OnPlay)); Events.OnPlaybackTick = (Action)Delegate.Combine(Events.OnPlaybackTick, new Action(OnPlaybackTick)); Events.OnStopPlayback = (Action)Delegate.Combine(Events.OnStopPlayback, new Action(OnStopPlayback)); } public void ResetPlayhead() { playbackTime = 0f; } public void MovePlayhead(float amount) { playbackTime += amount; } public void Tick() { if (Director.PlayState == PlayState.Playing) { Events.OnPlaybackTick?.Invoke(); } } public void BeginPlayback() { if (Director.LastPlayState == PlayState.Paused) { Director.instance.SetPlayState(PlayState.Playing); } else if (playRoutine == null) { ref Coroutine reference = ref playRoutine; object obj = MelonCoroutines.Start(PlayRoutine()); reference = (Coroutine)((obj is Coroutine) ? obj : null); } } public void OnPrePlayback() { ResetPlayhead(); foreach (Actor item in Director.instance.Cast) { item.OnSceneBegin(); } foreach (Prop worldProp in Director.instance.WorldProps) { worldProp.OnSceneBegin(); ((Component)worldProp).gameObject.SetActive(true); } } public void OnPlay() { foreach (Actor item in Director.instance.Cast) { if (item != null) { item?.Microphone?.Playback(); } } } public void OnPlaybackTick() { if (Director.PlayState != PlayState.Stopped && Director.PlayState != PlayState.Paused) { AnimateAll(); playbackTime += PlaybackRate * Time.deltaTime; } } public void OnStopPlayback() { foreach (Actor item in Director.instance.Cast) { if (item != null && item is Actor actor) { actor?.Microphone?.StopPlayback(); } } if (playRoutine != null) { MelonCoroutines.Stop((object)playRoutine); playRoutine = null; } } public void Seek(float amount) { if (Director.PlayState == PlayState.Stopped) { if (playbackTime <= 0f) { playbackTime = 0f; } if (playbackTime >= Recorder.instance.TakeTime) { playbackTime = Recorder.instance.TakeTime; } AnimateAll(); playbackTime += amount; } } public void AnimateAll() { foreach (Actor item in Director.instance.Cast) { AnimateActor(item); } foreach (Prop worldProp in Director.instance.WorldProps) { AnimateProp(worldProp); } } public void AnimateActor(Trackable actor) { actor?.Act(); } public void AnimateProp(Prop prop) { if ((Object)(object)prop != (Object)null) { prop.Act(); } } public IEnumerator PlayRoutine() { Events.OnPrePlayback?.Invoke(); Countdown = 0; while (Countdown < Settings.World.delay) { Events.OnTimerCountdown?.Invoke(); yield return (object)new WaitForSeconds(1f); Countdown++; } Main.feedbackSFX.BeepHigh(); Events.OnPlay?.Invoke(); while (Director.PlayState == PlayState.Playing || Director.PlayState == PlayState.Paused) { while (Director.PlayState == PlayState.Paused) { yield return null; } if (PlaybackTime >= Recorder.instance.TakeTime) { break; } Tick(); yield return null; } Events.OnStopPlayback?.Invoke(); yield return null; } } public class Recorder { public static Recorder instance; public float TakeTime; public List<Actor> ActiveActors = new List<Actor>(); private Actor activeActor; private Actor lastActor; private Coroutine recordRoutine; private float fpsTimer; private float recordingTime; private float timeSinceLastTick; private int recordTick; public float RecordingTime => recordingTime; public int RecordTick => recordTick; public int Countdown { get; private set; } public Actor ActiveActor => activeActor; public Actor LastActor => lastActor; public Recorder() { instance = this; Events.OnPreRecord = (Action)Delegate.Combine(Events.OnPreRecord, new Action(OnPreRecord)); Events.OnStartRecording = (Action)Delegate.Combine(Events.OnStartRecording, new Action(OnPostRecord)); Events.OnRecordTick = (Action)Delegate.Combine(Events.OnRecordTick, new Action(OnRecordTick)); Events.OnStopRecording = (Action)Delegate.Combine(Events.OnStopRecording, new Action(OnStopRecording)); } public void SetActor(Avatar avatar) { lastActor = activeActor; activeActor = new Actor(avatar); } public void Tick() { if (Director.PlayState == PlayState.Recording) { Events.OnRecordTick?.Invoke(); } } public void StartRecordRoutine() { if (recordRoutine == null) { ref Coroutine reference = ref recordRoutine; object obj = MelonCoroutines.Start(RecordRoutine()); reference = (Coroutine)((obj is Coroutine) ? obj : null); } } public void RecordCamera() { foreach (Actor item in Director.instance.Cast) { item?.Act(); } } public void RecordActor() { activeActor.RecordFrame(); foreach (Prop recordingProp in Director.instance.RecordingProps) { recordingProp.Record(recordTick); } foreach (Actor item in Director.instance.Cast) { Playback.Instance.AnimateActor(item); } foreach (Prop worldProp in Director.instance.WorldProps) { Playback.Instance.AnimateProp(worldProp); } } public void OnPreRecord() { if (recordTick > 0) { recordTick = 0; } Playback.Instance.ResetPlayhead(); fpsTimer = 0f; recordingTime = 0f; SetActor(Constants.rigManager.avatar); foreach (Actor item in Director.instance.Cast) { item.OnSceneBegin(); } foreach (Prop worldProp in Director.instance.WorldProps) { worldProp.OnSceneBegin(); ((Component)worldProp).gameObject.SetActive(true); } } public void OnPostRecord() { activeActor?.Microphone?.RecordMicrophone(); foreach (Actor item in Director.instance.Cast) { if (item != null && item is Actor actor) { actor?.Microphone?.Playback(); } } } public void OnRecordTick() { if (Director.PlayState == PlayState.Paused) { return; } recordTick++; recordingTime += timeSinceLastTick; if (recordingTime > TakeTime) { TakeTime = recordingTime; } Playback.Instance.MovePlayhead(timeSinceLastTick); if (Director.CaptureState == CaptureState.CaptureCamera) { RecordCamera(); } if (Director.CaptureState == CaptureState.CaptureActor) { RecordActor(); } foreach (Actor item in Director.instance.Cast) { item?.Act(); } } public void OnStopRecording() { activeActor?.Microphone?.StopRecording(); foreach (Actor item in Director.instance.Cast) { if (item != null && item is Actor actor) { actor?.Microphone?.StopPlayback(); } } activeActor.CloneAvatar(); Director.instance.Cast.Add(activeActor); lastActor = activeActor; activeActor = null; Director.instance.Cast.AddRange(ActiveActors); ActiveActors.Clear(); Director.instance.WorldProps.AddRange(Director.instance.RecordingProps); Director.instance.LastRecordedProps = Director.instance.RecordingProps; Director.instance.RecordingProps.Clear(); if (recordRoutine != null) { MelonCoroutines.Stop((object)recordRoutine); recordRoutine = null; } } public IEnumerator RecordRoutine() { Events.OnPreRecord?.Invoke(); Countdown = 0; while (Countdown < Settings.World.delay) { Events.OnTimerCountdown?.Invoke(); yield return (object)new WaitForSeconds(1f); Countdown++; } Main.feedbackSFX.BeepHigh(); Events.OnStartRecording?.Invoke(); float perTick = 1f / Settings.World.fps; while (Director.PlayState == PlayState.Recording || Director.PlayState == PlayState.Paused) { if (Settings.World.ignoreSlomo) { timeSinceLastTick += Time.deltaTime; } else { timeSinceLastTick += Time.unscaledDeltaTime; } if (Settings.World.temporalScaling) { fpsTimer += Time.unscaledDeltaTime; } else { fpsTimer += Time.deltaTime; } if (fpsTimer > perTick) { Tick(); fpsTimer = 0f; timeSinceLastTick = 0f; } yield return null; } Events.OnStopRecording?.Invoke(); yield return null; } } } namespace NEP.MonoDirector.Cameras { [RegisterTypeInIl2Cpp] public class CameraDamp : MonoBehaviour { public float delta = 4f; private Quaternion lastRotation; public CameraDamp(IntPtr ptr) : base(ptr) { } private void LateUpdate() { } } [RegisterTypeInIl2Cpp] public class CameraDisplay : MonoBehaviour { private SmoothFollower 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() { smoothFollower = ((Component)this).GetComponent<SmoothFollower>(); ((Behaviour)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(smoothFollower.targetTransform); } } [RegisterTypeInIl2Cpp] public class FOVController : MonoBehaviour { public float fovChangeSmoothing = 10f; public float fovChangeRate = 4f; private Camera camera; private float fieldOfView = 90f; private float lastFieldOfView; public FOVController(IntPtr ptr) : base(ptr) { } private void Update() { MouseFOV(); } private void LateUpdate() { camera.fieldOfView = Mathf.Lerp(lastFieldOfView, fieldOfView, fovChangeSmoothing * Time.deltaTime); } private void MouseFOV() { lastFieldOfView = camera.fieldOfView; SetFOV(Input.GetAxisRaw("Mouse ScrollWheel") * fovChangeRate); } public void SetCamera(Camera camera) { this.camera = camera; } public void SetFOV(float fov) { fieldOfView -= fov; } } [RegisterTypeInIl2Cpp] public class HandheldCamera : MonoBehaviour { private CylinderGrip leftHandle; private CylinderGrip rightHandle; private Transform leftHandleTransform; private Transform rightHandleTransform; private Camera sensorCamera; private GameObject backViewfinderScreen; private GameObject frontViewfinderScreen; private GameObject displayScreen; private Rigidbody cameraRigidbody; private RenderTexture displayTexture => sensorCamera.targetTexture; public HandheldCamera(IntPtr ptr) : base(ptr) { } private void Awake() { leftHandleTransform = ((Component)this).transform.Find("Grips/Left Handle"); rightHandleTransform = ((Component)this).transform.Find("Grips/Right Handle"); sensorCamera = ((Component)((Component)this).transform.Find("Sensor")).GetComponent<Camera>(); backViewfinderScreen = ((Component)((Component)this).transform.Find("Viewfinder_Back")).gameObject; frontViewfinderScreen = ((Component)((Component)this).transform.Find("Viewfinder_Front")).gameObject; displayScreen = ((Component)((Component)this).transform.Find("Screen")).gameObject; leftHandle = ((Component)leftHandleTransform).GetComponent<CylinderGrip>(); rightHandle = ((Component)rightHandleTransform).GetComponent<CylinderGrip>(); cameraRigidbody = ((Component)this).GetComponent<Rigidbody>(); } private void OnEnable() { Events.OnCameraModeSet = (Action<CameraMode>)Delegate.Combine(Events.OnCameraModeSet, new Action<CameraMode>(OnCameraModeChanged)); CylinderGrip obj = leftHandle; ((Grip)obj).attachedUpdateDelegate = ((Grip)obj).attachedUpdateDelegate + HandDelegate.op_Implicit((Action<Hand>)LeftHandUpdate); CylinderGrip obj2 = rightHandle; ((Grip)obj2).attachedUpdateDelegate = ((Grip)obj2).attachedUpdateDelegate + HandDelegate.op_Implicit((Action<Hand>)RightHandUpdate); CylinderGrip obj3 = leftHandle; ((Grip)obj3).detachedHandDelegate = ((Grip)obj3).detachedHandDelegate + HandDelegate.op_Implicit((Action<Hand>)LeftHandDetached); CylinderGrip obj4 = leftHandle; ((Grip)obj4).detachedHandDelegate = ((Grip)obj4).detachedHandDelegate + HandDelegate.op_Implicit((Action<Hand>)RightHandDetached); } private void OnDisable() { Events.OnCameraModeSet = (Action<CameraMode>)Delegate.Remove(Events.OnCameraModeSet, new Action<CameraMode>(OnCameraModeChanged)); CylinderGrip obj = leftHandle; ((Grip)obj).attachedUpdateDelegate = ((Grip)obj).attachedUpdateDelegate - HandDelegate.op_Implicit((Action<Hand>)LeftHandUpdate); CylinderGrip obj2 = rightHandle; ((Grip)obj2).attachedUpdateDelegate = ((Grip)obj2).attachedUpdateDelegate - HandDelegate.op_Implicit((Action<Hand>)RightHandUpdate); CylinderGrip obj3 = leftHandle; ((Grip)obj3).detachedHandDelegate = ((Grip)obj3).detachedHandDelegate - HandDelegate.op_Implicit((Action<Hand>)LeftHandDetached); CylinderGrip obj4 = leftHandle; ((Grip)obj4).detachedHandDelegate = ((Grip)obj4).detachedHandDelegate - HandDelegate.op_Implicit((Action<Hand>)RightHandDetached); } private void OnCameraModeChanged(CameraMode mode) { if (mode == CameraMode.Handheld) { displayScreen.active = true; backViewfinderScreen.active = true; frontViewfinderScreen.active = true; CameraRigManager.Instance.ClonedCamera.targetTexture = displayTexture; ((Component)CameraRigManager.Instance.ClonedCamera).gameObject.SetActive(true); CameraRigManager.Instance.FollowCamera.SetFollowTarget(((Component)sensorCamera).transform); CameraRigManager.Instance.CameraDisplay.FollowCamera.SetFollowTarget(((Component)sensorCamera).transform); } else { displayScreen.active = false; backViewfinderScreen.active = false; frontViewfinderScreen.active = false; ((Component)CameraRigManager.Instance.ClonedCamera).gameObject.SetActive(false); CameraRigManager.Instance.FollowCamera.SetDefaultTarget(); } } private void LeftHandUpdate(Hand hand) { cameraRigidbody.isKinematic = false; if (hand.GetIndexTriggerAxis() > 0.25f) { float fovChangeRate = CameraRigManager.Instance.FOVController.fovChangeRate; CameraRigManager.Instance.CameraDisplay.FOVController.SetFOV(0f - hand.GetIndexTriggerAxis() * fovChangeRate / 10f); CameraRigManager.Instance.FOVController.SetFOV(0f - hand.GetIndexTriggerAxis() * fovChangeRate / 10f); } } private void RightHandUpdate(Hand hand) { cameraRigidbody.isKinematic = false; if (hand.GetIndexTriggerAxis() > 0.25f) { float fovChangeRate = CameraRigManager.Instance.FOVController.fovChangeRate; CameraRigManager.Instance.CameraDisplay.FOVController.SetFOV(hand.GetIndexTriggerAxis() * fovChangeRate / 10f); CameraRigManager.Instance.FOVController.SetFOV(hand.GetIndexTriggerAxis() * fovChangeRate / 10f); } } private void LeftHandDetached(Hand hand) { if (Settings.Camera.handheldKinematicOnRelease) { cameraRigidbody.isKinematic = true; } } private void RightHandDetached(Hand hand) { if (Settings.Camera.handheldKinematicOnRelease) { cameraRigidbody.isKinematic = true; } } } [RegisterTypeInIl2Cpp] public class InputController : MonoBehaviour { public float mouseSensitivity = 1f; public float mouseSmoothness = 4f; private Vector3 keyboardInput; private Vector3 mouseInput; private float xMouseMove; private float yMouseMove; private bool enableKeyboard = true; private bool enableMouse = true; private bool lockCursor; public InputController(IntPtr ptr) : base(ptr) { } private void Update() { lockCursor = Input.GetMouseButton(1); Cursor.lockState = (CursorLockMode)(lockCursor ? 1 : 0); Cursor.visible = !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 (!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)) { keyboardInput.x = -1f; } else if (Input.GetKeyUp((KeyCode)97)) { keyboardInput.x = 0f; } if (Input.GetKey((KeyCode)100)) { keyboardInput.x = 1f; } else if (Input.GetKeyUp((KeyCode)100)) { keyboardInput.x = 0f; } if (Input.GetKey((KeyCode)119)) { keyboardInput.z = 1f; } else if (Input.GetKeyUp((KeyCode)119)) { keyboardInput.z = 0f; } if (Input.GetKey((KeyCode)115)) { keyboardInput.z = -1f; } else if (Input.GetKeyUp((KeyCode)115)) { keyboardInput.z = 0f; } keyboardInput.y = num + num2; return keyboardInput; } 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 (!enableMouse) { return Vector3.zero; } if (xMouseMove > 0f || xMouseMove < 0f) { xMouseMove = Mathf.Lerp(xMouseMove, 0f, mouseSmoothness * Time.deltaTime); } if (yMouseMove > 0f || yMouseMove < 0f) { yMouseMove = Mathf.Lerp(yMouseMove, 0f, mouseSmoothness * Time.deltaTime); } if (!lockCursor) { return mouseInput; } float axisRaw = Input.GetAxisRaw("Mouse X"); float axisRaw2 = Input.GetAxisRaw("Mouse Y"); if (Input.GetKey((KeyCode)306) && Input.GetMouseButton(1)) { mouseInput.z -= axisRaw; } xMouseMove += axisRaw * Time.deltaTime; yMouseMove += axisRaw2 * Time.deltaTime; mouseInput.x += xMouseMove * mouseSensitivity; mouseInput.y -= yMouseMove * mouseSensitivity; return mouseInput; } } public class CameraRigManager { private GameObject cameraObject; private CameraMode cameraMode; private GameObject cameraModel; private MeshRenderer cameraRenderer; 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 cameraMode; } set { cameraMode = value; if (cameraMode == CameraMode.None) { ((Behaviour)FreeCamera).enabled = false; ((Behaviour)CameraDamp).enabled = false; ((Behaviour)FollowCamera).enabled = false; ((Behaviour)SmoothFollower).enabled = true; } if (cameraMode == CameraMode.Free) { ((Behaviour)SmoothFollower).enabled = false; ((Behaviour)FreeCamera).enabled = true; ((Behaviour)CameraDamp).enabled = false; ((Behaviour)FollowCamera).enabled = false; } if (cameraMode == CameraMode.Head) { ((Behaviour)SmoothFollower).enabled = false; ((Behaviour)CameraDamp).enabled = false; ((Behaviour)FollowCamera).enabled = true; ((Behaviour)FreeCamera).enabled = false; } Events.OnCameraModeSet?.Invoke(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 component = ((Component)Player.rigManager).GetComponent<RigScreenOptions>(); RigScreenOptions = component; Start(); } private void Start() { Instance = this; InitializeCamera(RigScreenOptions); } private void InitializeCamera(RigScreenOptions screenOptions) { Camera = screenOptions.cam; cameraObject = ((Component)Camera).gameObject; ClonedCamera = Object.Instantiate<GameObject>(cameraObject).GetComponent<Camera>(); ((Component)ClonedCamera).gameObject.SetActive(false); cameraObject.transform.parent = null; SmoothFollower = cameraObject.GetComponent<SmoothFollower>(); InputController = cameraObject.AddComponent<InputController>(); FreeCamera = cameraObject.AddComponent<FreeCamera>(); FOVController = cameraObject.AddComponent<FOVController>(); FollowCamera = cameraObject.AddComponent<FollowCamera>(); CameraDamp = cameraObject.AddComponent<CameraDamp>(); CameraVolumes = new CameraVolume[2] { 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> { { BodyPart.Head, new BodyPartData(CameraRigManager.Instance.RigScreenOptions.TargetTransform) }, { BodyPart.Chest, new BodyPartData(((Rig)Constants.rigManager.physicsRig).m_chest) }, { BodyPart.Pelvis, new BodyPartData(((Rig)Constants.rigManager.physicsRig).m_pelvis) } }; public float delta = 4f; private Vector3 positionOffset; private Vector3 rotationEulerOffset; private Transform followTarget; public Transform FollowTarget => followTarget; public FollowCamera(IntPtr ptr) : base(ptr) { } protected void Update() { //IL_002a: 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_004b: 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) if ((Object)(object)followTarget == (Object)null) { Main.Logger.Msg("Follow target is null!"); return; } ((Component)this).transform.position = followTarget.position; ((Component)this).transform.rotation = Quaternion.Slerp(((Component)this).transform.rotation, followTarget.rotation, delta * Time.deltaTime); } public void SetDefaultTarget() { SetFollowTarget(FollowPoints[BodyPart.Head].transform); } public void SetFollowTarget(Transform target) { 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) 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) 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) 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) positionOffset = Vector3.zero; rotationEulerOffset = Vector3.zero; Vector3 position = FollowPoints[part].position; followTarget.position = position; followTarget.localPosition = positionOffset; followTarget.localRotation = Quaternion.Euler(rotationEulerOffset); } } [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 shakeVector; private Vector3 wishDir = Vector3.zero; private float currentSpeed; private Rigidbody rigidbody; private InputController inputController = CameraRigManager.Instance.InputController; private bool 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() { rigidbody = ((Component)this).gameObject.AddComponent<Rigidbody>(); 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 = inputController.MouseMove(); float num = Mathf.Sin(Time.time) + Mathf.PerlinNoise(CameraSettings.xShake * Time.time, CameraSettings.yShake) * shakeVector.x; float num2 = Mathf.Sin(Time.time) + Mathf.PerlinNoise(CameraSettings.xShake, 1f - CameraSettings.yShake * Time.time) * shakeVector.y; float num3 = num2 * 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 = inputController.KeyboardMove(); Vector3.ClampMagnitude(wishDir, CameraSettings.maxSpeed); Transform transform = ((Component)CameraRigManager.Instance.Camera).transform; currentSpeed = (fastCamera ? CameraSettings.fastSpeed : CameraSettings.slowSpeed); val = Vector3.ClampMagnitude(val, CameraSettings.maxSpeed); wishDir = transform.right * val.x + transform.up * val.y + transform.forward * val.z; rigidbody.AddForce(wishDir * currentSpeed); rigidbody.drag = CameraSettings.friction; } } [RegisterTypeInIl2Cpp] public class SplineNode : MonoBehaviour { private SplineContainer splineContainer; private SplineAnimate splineAnimator; private Transform lookAtTarget; private SphereGrip nodeGrip; private int nodeIndex; public static int nodeCounter { get; private set; } public SplineNode(IntPtr ptr) : base(ptr) { } private void Start() { splineContainer = CreateSplineContainer(); InitializeSplineAnimator(splineAnimator); nodeGrip = ((Component)((Component)this).transform.Find("Collider")).GetComponent<SphereGrip>(); SphereGrip obj = nodeGrip; ((Grip)obj).attachedUpdateDelegate = ((Grip)obj).attachedUpdateDelegate + HandDelegate.op_Implicit((Action<Hand>)OnTriggerGripUpdate); } private void OnEnable() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) CreatePoint(((Component)this).transform.position, ((Component)this).transform.rotation); } private void OnDisable() { RemovePoint(nodeIndex); } private void Update() { //IL_0010: 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) if (Input.GetKeyDown((KeyCode)109)) { CreatePoint(((Component)this).transform.position, ((Component)this).transform.rotation); } if ((Object)(object)lookAtTarget != (Object)null) { ((Component)this).transform.LookAt(lookAtTarget); } } private void OnTriggerGripUpdate(Hand hand) { } private void CreatePoint(Vector3 position, Quaternion rotation) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0045: 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_004b: 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_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown if (splineContainer.Spline == null) { splineContainer.Spline = new Spline(); } splineContainer.Spline.m_EditModeType = (SplineType)0; BezierKnot val = default(BezierKnot); val.Position = float3.op_Implicit(position); val.Rotation = quaternion.op_Implicit(rotation); splineContainer.Spline.Add(val); MonoBehaviour.print(Object.op_Implicit("Spline knot added!"));