using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using CameraMod; using HarmonyLib; using Il2Cpp; using Il2CppActiveRagdoll; using Il2CppHurricaneVR.Framework.ControllerInput; using Il2CppHurricaneVR.Framework.Core; using Il2CppHurricaneVR.Framework.Core.Grabbers; using Il2CppHurricaneVR.Framework.Core.HandPoser; using Il2CppHurricaneVR.Framework.Core.Sockets; using Il2CppHurricaneVR.Framework.Shared; using Il2CppInterop.Runtime.InteropTypes; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppSystem; using Il2CppSystem.Collections; using Il2CppSystem.Collections.Generic; using Il2CppTMPro; using MelonLoader; using Microsoft.CodeAnalysis; using NeckBreakingMod; using UnityEngine; using UnityEngine.Rendering.Universal; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: MelonInfo(typeof(CameraClass), "Camera Mod", "2.0.2", "BekoniX", null)] [assembly: MelonGame("Kubunautilus", "BrutalistickVR")] [assembly: AssemblyTitle("CameraMod")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("cameramod")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("8c5cf839-fb45-4c19-b329-39d7307605a8")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace CameraMod { public class CameraSettings { public float CamPos = 1f; public float CamRot = 0.1f; public float DronePos = 0.05f; public float FOV = 110f; public static void SaveSettings(CameraSettings settings) { string path = "Mods/CameraMod/settings.txt"; Directory.CreateDirectory(Path.GetDirectoryName(path)); List contents = new List { $"CameraPositionSmoothing (Smaller = more smoothing)={settings.CamPos}", $"CameraRotationSmoothing (Smaller = more smoothing)={settings.CamRot}", $"DronePositionSmoothing (Smaller = more smoothing)={settings.DronePos}", $"Camera FOV (110 by default)={settings.FOV}" }; File.WriteAllLines(path, contents); } public static CameraSettings LoadSettings() { string path = "Mods/CameraMod/settings.txt"; CameraSettings cameraSettings = new CameraSettings(); if (!File.Exists(path)) { Directory.CreateDirectory(Path.GetDirectoryName(path)); List contents = new List { $"CameraPositionSmoothing (Smaller = more smoothing)={cameraSettings.CamPos}", $"CameraRotationSmoothing (Smaller = more smoothing)={cameraSettings.CamRot}", $"DronePositionSmoothing (Smaller = more smoothing)={cameraSettings.DronePos}", $"Camera FOV (110 by default)={cameraSettings.FOV}" }; File.WriteAllLines(path, contents); return cameraSettings; } string[] array = File.ReadAllLines(path); foreach (string text in array) { string[] array2 = text.Split('='); if (array2.Length == 2) { string text2 = array2[0].Trim(); string s = array2[1].Trim(); switch (text2) { case "CameraPositionSmoothing (Smaller = more smoothing)": cameraSettings.CamPos = float.Parse(s); break; case "CameraRotationSmoothing (Smaller = more smoothing)": cameraSettings.CamRot = float.Parse(s); break; case "DronePositionSmoothing (Smaller = more smoothing": cameraSettings.DronePos = float.Parse(s); break; case "Camera FOV (110 by default)": cameraSettings.FOV = float.Parse(s); break; } } } return cameraSettings; } } } namespace NeckBreakingMod { public class CameraClass : MelonMod { [HarmonyPatch(typeof(HVRHandGrabber), "OnGrabbed")] public static class PatchGrab { public static void Postfix(HVRHandGrabber __instance) { if (!(Time.time - sceneLoadTime < 1f)) { GameObject gameObject = ((Component)((HVRGrabberBase)__instance).HeldObject).gameObject; if (Object.op_Implicit((Object)(object)gameObject.gameObject.transform.Find("CameraModel"))) { HoldingCamCoroutine = MelonCoroutines.Start(HoldingCam(((Component)((HVRGrabberBase)__instance).HeldObject).gameObject)); } } } } [HarmonyPatch(typeof(HVRHandGrabber), "OnReleased")] public static class PatchRelease { public static void Prefix(HVRHandGrabber __instance) { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) if (Time.time - sceneLoadTime < 1f) { return; } GameObject gameObject = ((Component)((HVRGrabberBase)__instance).HeldObject).gameObject; if (Object.op_Implicit((Object)(object)gameObject.gameObject.transform.Find("CameraModel"))) { MelonCoroutines.Stop(HoldingCamCoroutine); Vector3 val = UpperChest.transform.position - ((Component)__instance).transform.position; if (((Vector3)(ref val)).sqrMagnitude < 0.04f) { MelonCoroutines.Start(HideCamera(gameObject.transform)); } } } } private static EnemyWaveSpawner waveSpawner; private static List HubHealthScripts = new List(); private static ModLoaderMelee MeleeModLoader; public static bool correctScene = false; private static bool HubScene = false; public static float backAmount = 1.5f; public static float upAmount = 0.65f; public static float droneSmoothing = 0.05f; public static float cameraFOV = 110f; public static AssetBundle droneBundle; public static GameObject DroneObject; private AssetBundle cameraBundle; private GameObject CameraObject; private bool CameraLoaded = false; private bool ModLoaderLoaded = false; private static TextMeshPro ModeText; public static CameraSettings camSettings; public static GameObject PlayerChar; public static GameObject HeadPivot; public static GameObject playerHead; public static GameObject EyeballR; public static GameObject EyeballL; public static GameObject playerNeck; private static GameObject UpperChest; private Transform LeftHand; private Transform RightHand; public static string CameraMode; public static GameObject displayCam; public static GameObject CameraTarget; public static float lastModeSwitch; public static float positionDamping = 1f; public static float rotationDamping = 0.1f; public static bool smoothCamera; public static GameObject specCam; public static GameObject pcCam; public static float sceneLoadTime; public static object HoldingCamCoroutine; public static HVRPlayerInputs playerInputs; public static void SetImmediateChildrenLayer(GameObject obj, int newLayer) { if (!((Object)(object)obj == (Object)null)) { int childCount = obj.transform.childCount; for (int i = 0; i < childCount; i++) { Transform child = obj.transform.GetChild(i); ((Component)child).gameObject.layer = newLayer; } } } public override void OnInitializeMelon() { camSettings = CameraSettings.LoadSettings(); positionDamping = camSettings.CamPos; rotationDamping = camSettings.CamRot; droneSmoothing = camSettings.DronePos; cameraFOV = camSettings.FOV; } public override void OnSceneWasLoaded(int buildIndex, string sceneName) { waveSpawner = null; pcCam = null; UpperChest = null; playerHead = null; playerInputs = null; playerNeck = null; EyeballR = null; EyeballL = null; DroneObject = null; if (sceneName != "MainMenuScene") { correctScene = true; sceneLoadTime = Time.time; lastModeSwitch = Time.time; GameObject[] array = Il2CppArrayBase.op_Implicit(Object.FindObjectsOfType()); GameObject[] array2 = array; foreach (GameObject val in array2) { if (!ModLoaderLoaded && (Object)(object)val != (Object)null && ((Object)val).name == "ModLoader") { ModLoaderLoaded = true; MeleeModLoader = val.GetComponent(); } } } if (sceneName == "MainHub") { HubScene = true; GameObject val2 = GameObject.Find("ShopStands"); HubHealthScripts.Clear(); HubHealthScripts.Add(((Component)val2.transform.Find("FarmerShopStand/FarmerDummy/GameObject/Physical")).GetComponent()); HubHealthScripts.Add(((Component)val2.transform.Find("PriestShopStand/PriestDummy/GameObject/Physical")).GetComponent()); HubHealthScripts.Add(((Component)val2.transform.Find("TommyShopStand/TracksuitDummy/GameObject/Physical")).GetComponent()); HubHealthScripts.Add(((Component)val2.transform.Find("HatterShopStand/HatterDummy/GameObject/Physical")).GetComponent()); HubHealthScripts.Add(((Component)val2.transform.Find("ScientistShopStand/HatterDummy/GameObject/Physical")).GetComponent()); } else { HubScene = false; } } private static AssetBundle LoadBundle(string resourcePath) { using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(resourcePath); if (stream == null) { MelonLogger.Error("Bundle not found: " + resourcePath); return null; } byte[] array = new byte[stream.Length]; stream.Read(array, 0, array.Length); return AssetBundle.LoadFromMemory(Il2CppStructArray.op_Implicit(array)); } private static Transform GetRandomEnemyHead() { if (!HubScene) { if ((Object)(object)waveSpawner != (Object)null && waveSpawner.stickHealthScripts.Count > 0) { int num = Random.Range(0, waveSpawner.stickHealthScripts.Count); return ((Component)waveSpawner.stickHealthScripts[num]).transform.Find("Body/Head"); } } else if (HubHealthScripts != null && HubHealthScripts.Count > 0) { int num2 = Random.Range(0, HubHealthScripts.Count); Transform val = null; if (!(HubHealthScripts[num2].GetCurrentHealth() > 0f)) { for (int i = 0; i < 10; i++) { if (HubHealthScripts.Count > 0) { int num3 = Random.Range(0, HubHealthScripts.Count); if (!(HubHealthScripts[num3].GetCurrentHealth() > 0f)) { HubHealthScripts.Remove(HubHealthScripts[num3]); } else { val = ((Component)HubHealthScripts[num3]).transform.Find("Body/Head"); } continue; } return null; } } else { val = ((Component)HubHealthScripts[num2]).transform.Find("Body/Head"); } if ((Object)(object)val != (Object)null) { return val; } } return null; } public override void OnFixedUpdate() { //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Expected O, but got Unknown //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0ada: Unknown result type (might be due to invalid IL or missing references) //IL_0ae5: Unknown result type (might be due to invalid IL or missing references) //IL_0aea: Unknown result type (might be due to invalid IL or missing references) //IL_0aef: Unknown result type (might be due to invalid IL or missing references) //IL_0839: Unknown result type (might be due to invalid IL or missing references) //IL_083e: Unknown result type (might be due to invalid IL or missing references) //IL_0854: Unknown result type (might be due to invalid IL or missing references) //IL_085b: Unknown result type (might be due to invalid IL or missing references) //IL_0860: Unknown result type (might be due to invalid IL or missing references) //IL_086a: Unknown result type (might be due to invalid IL or missing references) //IL_086f: Unknown result type (might be due to invalid IL or missing references) //IL_0874: Unknown result type (might be due to invalid IL or missing references) //IL_0880: Unknown result type (might be due to invalid IL or missing references) //IL_0885: Unknown result type (might be due to invalid IL or missing references) //IL_0887: Unknown result type (might be due to invalid IL or missing references) //IL_088c: Unknown result type (might be due to invalid IL or missing references) //IL_08a2: Unknown result type (might be due to invalid IL or missing references) //IL_08a7: Unknown result type (might be due to invalid IL or missing references) //IL_08ae: Unknown result type (might be due to invalid IL or missing references) //IL_08d7: Unknown result type (might be due to invalid IL or missing references) //IL_08ec: Unknown result type (might be due to invalid IL or missing references) //IL_08fb: Unknown result type (might be due to invalid IL or missing references) //IL_0900: Unknown result type (might be due to invalid IL or missing references) //IL_0905: Unknown result type (might be due to invalid IL or missing references) //IL_0907: Unknown result type (might be due to invalid IL or missing references) //IL_0909: Unknown result type (might be due to invalid IL or missing references) //IL_090e: Unknown result type (might be due to invalid IL or missing references) //IL_0924: Unknown result type (might be due to invalid IL or missing references) //IL_0929: Unknown result type (might be due to invalid IL or missing references) //IL_0930: Unknown result type (might be due to invalid IL or missing references) //IL_0945: Unknown result type (might be due to invalid IL or missing references) //IL_094a: Unknown result type (might be due to invalid IL or missing references) //IL_095b: Unknown result type (might be due to invalid IL or missing references) //IL_0968: Unknown result type (might be due to invalid IL or missing references) //IL_096f: Unknown result type (might be due to invalid IL or missing references) //IL_098e: Unknown result type (might be due to invalid IL or missing references) //IL_09a0: Unknown result type (might be due to invalid IL or missing references) //IL_09b4: Unknown result type (might be due to invalid IL or missing references) //IL_09be: Unknown result type (might be due to invalid IL or missing references) //IL_0a43: Unknown result type (might be due to invalid IL or missing references) //IL_0a5d: Unknown result type (might be due to invalid IL or missing references) //IL_0a77: Unknown result type (might be due to invalid IL or missing references) //IL_0a91: Unknown result type (might be due to invalid IL or missing references) //IL_0c0a: Unknown result type (might be due to invalid IL or missing references) //IL_0c15: Unknown result type (might be due to invalid IL or missing references) //IL_0c1a: Unknown result type (might be due to invalid IL or missing references) //IL_0c1f: Unknown result type (might be due to invalid IL or missing references) //IL_0b4d: Unknown result type (might be due to invalid IL or missing references) //IL_070e: Unknown result type (might be due to invalid IL or missing references) //IL_071d: Unknown result type (might be due to invalid IL or missing references) //IL_0727: Unknown result type (might be due to invalid IL or missing references) //IL_0746: Unknown result type (might be due to invalid IL or missing references) //IL_0755: Unknown result type (might be due to invalid IL or missing references) //IL_075f: Unknown result type (might be due to invalid IL or missing references) //IL_0c7d: Unknown result type (might be due to invalid IL or missing references) //IL_0bc7: Unknown result type (might be due to invalid IL or missing references) //IL_0798: Unknown result type (might be due to invalid IL or missing references) //IL_07a7: Unknown result type (might be due to invalid IL or missing references) //IL_07b6: Unknown result type (might be due to invalid IL or missing references) //IL_07c0: Unknown result type (might be due to invalid IL or missing references) //IL_07c5: Unknown result type (might be due to invalid IL or missing references) //IL_07cf: Unknown result type (might be due to invalid IL or missing references) //IL_07ee: Unknown result type (might be due to invalid IL or missing references) //IL_07fd: Unknown result type (might be due to invalid IL or missing references) //IL_0807: Unknown result type (might be due to invalid IL or missing references) //IL_0cf7: Unknown result type (might be due to invalid IL or missing references) //IL_0654: Unknown result type (might be due to invalid IL or missing references) //IL_0678: Unknown result type (might be due to invalid IL or missing references) //IL_0535: Unknown result type (might be due to invalid IL or missing references) if (Time.time - sceneLoadTime < 1f) { return; } if ((Object)(object)pcCam == (Object)null && correctScene) { GameObject[] array = Il2CppArrayBase.op_Implicit(Object.FindObjectsOfType()); GameObject[] array2 = array; foreach (GameObject val in array2) { if (((Object)(object)val != (Object)null && ((Object)val).name == "Hexa4Rig26.10.23") || ((Object)val).name == "Hexa4Rig26.10.23(Clone)") { PlayerChar = val; pcCam = ((Component)val.transform.Find("HexaBody/PlayerHexaPelvis/CameraRig/FloorOffset/Scaler/Camera")).gameObject; UpperChest = ((Component)val.transform.Find("HexaBody/PlayerHexaPelvis/PhysicalUpperbody/Physical/Body/PlayerPelvis/MiddleChestPoint/MiddleChest/UpperChestPoint/PlayerUpperChest")).gameObject; playerHead = ((Component)val.transform.Find("HexaBody/PlayerHexaPelvis/PhysicalUpperbody/Physical/Body/Head")).gameObject; LeftHand = val.transform.Find("Physics LeftHand"); RightHand = val.transform.Find("Physics RightHand"); EyeballL = ((Component)playerHead.transform.Find("Eyeball_L")).gameObject; EyeballR = ((Component)playerHead.transform.Find("Eyeball_R")).gameObject; ((Component)pcCam.transform.Find("DamageOverlay")).gameObject.layer = 16; } if (((Object)(object)val != (Object)null && ((Object)val).name == "WaveSpawnButton (1)") || ((Object)val).name == "WaveSpawnButton(Clone)") { waveSpawner = ((Component)val.transform.GetChild(0)).GetComponent(); } } GameObject val2 = new GameObject("SpectatorCamera"); UniversalAdditionalCameraData val3 = val2.AddComponent(); val3.allowXRRendering = false; val2.AddComponent(); val2.transform.SetParent((Transform)null, true); Camera component = val2.GetComponent(); val2.tag = "Untagged"; component.stereoTargetEye = (StereoTargetEyeMask)0; component.targetDisplay = 0; val3.renderPostProcessing = true; pcCam.SetActive(true); component.fieldOfView = cameraFOV; component.nearClipPlane = 0.01f; val2.transform.position = pcCam.transform.position; val2.transform.localPosition = new Vector3(0f, 0f, 0f); pcCam.GetComponent().cullingMask = -32769; component.cullingMask = -65537; component.cullingMask &= -16385; component.cullingMask &= -32769; playerInputs = PlayerChar.GetComponent(); specCam = val2; smoothCamera = true; CameraTarget = pcCam; CameraMode = "FirstPerson"; } if (correctScene && ((Object)(object)DroneObject == (Object)null || (Object)(object)CameraObject == (Object)null)) { if ((Object)(object)droneBundle == (Object)null) { droneBundle = LoadBundle("CameraMod.Resources.bekdrone"); cameraBundle = LoadBundle("CameraMod.Resources.bekcamera"); } if ((Object)(object)droneBundle != (Object)null && (Object)(object)cameraBundle != (Object)null) { Il2CppArrayBase val4 = droneBundle.LoadAllAssets(); if (!CameraLoaded) { CameraLoaded = true; Il2CppArrayBase val5 = cameraBundle.LoadAllAssets(); GameObject val6 = null; foreach (GameObject item in val5) { if (((Object)item).name == "Camera" && (Object)(object)MeleeModLoader != (Object)null) { val6 = Object.Instantiate(item, MeleeModLoader.instantiatedPrefabParent.transform); } } MeleeWeaponWrapper component2 = val6.GetComponent(); GameObject val7 = MeleeModLoader.CreateMeleePrefab(val6, component2.meleeWeaponSO, component2.collidersForDetectingGrab, component2.stabbingColliders, component2); } IEnumerator enumerator2 = MeleeModLoader.loadedUnsocketedModsParent.transform.GetEnumerator(); try { while (enumerator2.MoveNext()) { Object current2 = enumerator2.Current; if ((Object)(object)((Il2CppObjectBase)current2).TryCast() != (Object)null && current2 != null && (Object)(object)((Component)((Il2CppObjectBase)current2).Cast()).GetComponent() != (Object)null && ((Component)((Il2CppObjectBase)current2).Cast()).GetComponent().meleeWeaponSO.weaponName == "Camerabek") { CameraObject = Object.Instantiate(((Component)((Il2CppObjectBase)current2).Cast()).gameObject, (Transform)null); CameraObject.transform.position = new Vector3(0f, -100f, 0f); ModeText = ((Component)CameraObject.transform.Find("CameraModel/ModeText")).GetComponent(); ((TMP_Text)ModeText).text = "Mode: FP Smooth"; playerHead.layer = 16; EyeballL.layer = 16; EyeballR.layer = 16; ((Component)CameraObject.transform.Find("CameraModel/Screen/CameraPos/hmdCam")).gameObject.SetActive(true); Object.Destroy((Object)(object)CameraObject.GetComponent()); ConvertURPMatToPaintCel.ConvertToPaintCel(((Renderer)((Component)CameraObject.transform.GetChild(2)).GetComponent()).material); } } } finally { if (enumerator2 is IDisposable disposable) { disposable.Dispose(); } } if (val4 != null && val4.Length > 0) { DroneObject = Object.Instantiate(val4[1]); DroneObject.transform.localScale = new Vector3(0.3f, 0.3f, 0.3f); DroneObject.transform.position = new Vector3(0f, -10f, 0f); SetImmediateChildrenLayer(((Component)DroneObject.transform.Find("DroneModel")).gameObject, 16); } } } if (smoothCamera) { if (CameraMode != "DroneCam") { if (CameraMode != "BodyCam" && CameraMode != "Enemy") { specCam.transform.position = Vector3.Lerp(specCam.transform.position, CameraTarget.transform.position, positionDamping); specCam.transform.rotation = Quaternion.Lerp(specCam.transform.rotation, CameraTarget.transform.rotation, rotationDamping); } if (CameraMode == "Enemy") { specCam.transform.position = Vector3.Lerp(specCam.transform.position, CameraTarget.transform.position + CameraTarget.transform.forward * 0.15f, 1.5f); specCam.transform.rotation = Quaternion.Lerp(specCam.transform.rotation, CameraTarget.transform.rotation, 0.1f); } } else if ((Object)(object)DroneObject != (Object)null) { Vector3 forward = DroneObject.transform.forward; forward.y = 0f; ((Vector3)(ref forward)).Normalize(); Vector3 val8 = forward * backAmount + Vector3.up * upAmount; Vector3 val9 = CameraTarget.transform.position + val8; DroneObject.transform.position = Vector3.Lerp(DroneObject.transform.position, val9, droneSmoothing); specCam.transform.position = DroneObject.transform.Find("DroneModel/DCam").position; Vector3 val10 = CameraTarget.transform.position - specCam.transform.position; Quaternion val11 = Quaternion.LookRotation(val10); specCam.transform.rotation = Quaternion.Lerp(specCam.transform.rotation, val11, rotationDamping); Vector3 eulerAngles = specCam.transform.eulerAngles; DroneObject.transform.rotation = Quaternion.Euler(0f, eulerAngles.y + 180f, eulerAngles.z); DroneObject.transform.Find("DroneModel/DCam").rotation = Quaternion.Euler(0f - eulerAngles.x, DroneObject.transform.eulerAngles.y, DroneObject.transform.eulerAngles.z); float num = 15000f; GameObject gameObject = ((Component)DroneObject.transform.Find("DroneModel/RightFrontPr")).gameObject; GameObject gameObject2 = ((Component)DroneObject.transform.Find("DroneModel/LeftFrontPr")).gameObject; GameObject gameObject3 = ((Component)DroneObject.transform.Find("DroneModel/LeftBackPr")).gameObject; GameObject gameObject4 = ((Component)DroneObject.transform.Find("DroneModel/RightBackPr")).gameObject; gameObject.transform.Rotate(Vector3.up, num * Time.deltaTime); gameObject2.transform.Rotate(Vector3.up, num * Time.deltaTime); gameObject3.transform.Rotate(Vector3.up, num * Time.deltaTime); gameObject4.transform.Rotate(Vector3.up, num * Time.deltaTime); } } if (!((Object)(object)playerInputs != (Object)null)) { return; } Vector3 val12; if (playerInputs.IsLeftGrabActivated) { val12 = UpperChest.transform.position - LeftHand.position; if (((Vector3)(ref val12)).sqrMagnitude < 0.035f) { if ((Object)(object)((HVRGrabberBase)((Component)LeftHand).GetComponent()).HeldObject == (Object)null) { ((HVRGrabberBase)((Component)LeftHand).GetComponent()).ForceRelease(); CameraObject.transform.position = ((Component)LeftHand).transform.position; MelonCoroutines.Start(SummonCam(((Component)LeftHand).gameObject)); } else if (!(((Object)((Component)((HVRGrabberBase)((Component)LeftHand).GetComponent()).HeldObject).gameObject).name == "WristCannonMag(Clone)")) { ((HVRGrabberBase)((Component)LeftHand).GetComponent()).ForceRelease(); CameraObject.transform.position = ((Component)LeftHand).transform.position; MelonCoroutines.Start(SummonCam(((Component)LeftHand).gameObject)); } } } if (!playerInputs.IsRightGrabActivated) { return; } val12 = UpperChest.transform.position - RightHand.position; if (((Vector3)(ref val12)).sqrMagnitude < 0.035f) { if ((Object)(object)((HVRGrabberBase)((Component)RightHand).GetComponent()).HeldObject == (Object)null) { ((HVRGrabberBase)((Component)RightHand).GetComponent()).ForceRelease(); CameraObject.transform.position = ((Component)RightHand).transform.position; MelonCoroutines.Start(SummonCam(((Component)RightHand).gameObject)); } else if (!(((Object)((Component)((HVRGrabberBase)((Component)RightHand).GetComponent()).HeldObject).gameObject).name == "WristCannonMag(Clone)")) { ((HVRGrabberBase)((Component)RightHand).GetComponent()).ForceRelease(); CameraObject.transform.position = ((Component)RightHand).transform.position; MelonCoroutines.Start(SummonCam(((Component)RightHand).gameObject)); } } } private IEnumerator SummonCam(GameObject camHand) { yield return (object)new WaitForSeconds(0.1f); HVRPosableGrabPoint grabPoint = ((Component)CameraObject.transform.Find("GrabPoints/GrabPoint")).GetComponent(); camHand.GetComponent().Grab(CameraObject.GetComponent(), (HVRGrabTrigger)0, grabPoint); } private static IEnumerator EnemyPov(Transform enemyHead) { StickHealth cachedHealth = ((Component)enemyHead.parent.parent).GetComponent(); while (cachedHealth.GetCurrentHealth() > 0f) { if (CameraMode != "Enemy") { yield break; } yield return (object)new WaitForSeconds(1f); } yield return (object)new WaitForSeconds(5f); if (HubScene) { HubHealthScripts.Remove(cachedHealth); } Transform randomHead = GetRandomEnemyHead(); if ((Object)(object)randomHead != (Object)null) { CameraTarget = ((Component)randomHead).gameObject; specCam.transform.position = randomHead.position + randomHead.forward * 0.15f; specCam.transform.rotation = randomHead.rotation; if (HubScene) { HubHealthScripts.Remove(cachedHealth); } MelonCoroutines.Start(EnemyPov(randomHead)); } else { Camera component = specCam.GetComponent(); component.cullingMask &= -32769; playerHead.layer = 16; EyeballL.layer = 16; EyeballR.layer = 16; CameraTarget = pcCam; CameraMode = "FirstPerson"; ((TMP_Text)ModeText).text = "Mode: FP Smooth"; specCam.transform.SetParent((Transform)null, true); specCam.transform.position = pcCam.transform.position; specCam.transform.localPosition = new Vector3(0f, 0f, 0f); } } public static IEnumerator HoldingCam(GameObject CameraObject) { HVRGrabbable grabbable = ((Component)CameraObject.transform).GetComponent(); while (true) { if ((Object)(object)grabbable != (Object)null && ((grabbable.IsRightHandGrabbed && playerInputs.IsRightTriggerHoldActive) || (grabbable.IsLeftHandGrabbed && playerInputs.IsLeftTriggerHoldActive)) && Time.time - lastModeSwitch > 1f) { lastModeSwitch = Time.time; if (CameraMode == "FirstPerson") { Camera component = specCam.GetComponent(); component.cullingMask |= 0x8000; CameraTarget = UpperChest; CameraMode = "BodyCam"; ((TMP_Text)ModeText).text = "Mode: Bodycam"; specCam.transform.SetParent(UpperChest.transform, false); specCam.transform.position = UpperChest.transform.position; specCam.transform.rotation = UpperChest.transform.rotation; specCam.transform.localPosition = new Vector3(0f, 0.11f, 0.1f); continue; } if (CameraMode == "BodyCam") { CameraTarget = ((Component)CameraObject.transform.Find("CameraModel/Screen/CameraPos")).gameObject; CameraMode = "SelfieCam"; ((TMP_Text)ModeText).text = "Mode: Selfie"; playerHead.layer = 15; EyeballL.layer = 15; EyeballR.layer = 15; specCam.transform.SetParent((Transform)null, true); specCam.transform.position = CameraObject.transform.position; specCam.transform.localPosition = new Vector3(0f, 0f, 0f); continue; } if (CameraMode == "SelfieCam") { playerHead.layer = 15; EyeballL.layer = 15; EyeballR.layer = 15; CameraTarget = pcCam; CameraMode = "DroneCam"; ((TMP_Text)ModeText).text = "Mode: Drone"; specCam.transform.SetParent((Transform)null, true); continue; } if (CameraMode == "DroneCam") { playerHead.layer = 15; EyeballL.layer = 15; EyeballR.layer = 15; CameraMode = "Enemy"; ((TMP_Text)ModeText).text = "Mode: NPC Pov"; Transform randomHead = GetRandomEnemyHead(); if ((Object)(object)randomHead != (Object)null) { CameraTarget = ((Component)randomHead).gameObject; specCam.transform.position = randomHead.position + randomHead.forward * 0.2f; specCam.transform.rotation = randomHead.rotation; MelonCoroutines.Start(EnemyPov(randomHead)); } DroneObject.transform.position = new Vector3(0f, -10f, 0f); continue; } if (CameraMode == "Enemy") { Camera component2 = specCam.GetComponent(); component2.cullingMask &= -32769; playerHead.layer = 16; EyeballL.layer = 16; EyeballR.layer = 16; CameraTarget = pcCam; CameraMode = "FirstPerson"; ((TMP_Text)ModeText).text = "Mode: FP Smooth"; specCam.transform.SetParent((Transform)null, true); specCam.transform.position = pcCam.transform.position; specCam.transform.localPosition = new Vector3(0f, 0f, 0f); continue; } } yield return (object)new WaitForSeconds(0.1f); } } private static IEnumerator HideCamera(Transform CameraTransform) { yield return (object)new WaitForEndOfFrame(); CameraTransform.position = new Vector3(0f, -100f, 0f); } } }