using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using BepInEx.Core.Logging.Interpolation; using BepInEx.Logging; using BepInEx.Unity.IL2CPP; using Il2CppInterop.Runtime.Injection; using Il2CppInterop.Runtime.InteropTypes; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppSystem; using Il2CppSystem.Reflection; using Microsoft.CodeAnalysis; using UnityEngine; using UnityEngine.Rendering; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyCompany("Beacon")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("Beacon")] [assembly: AssemblyTitle("Beacon")] [assembly: AssemblyVersion("1.0.0.0")] [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 BigWalkBeaconMod { [BepInPlugin("com.gogogadgetjustice.bigwalk.beaconmod", "BigWalkBeaconMod", "1.2.0")] public class BeaconModPlugin : BasePlugin { internal static ManualLogSource Log; public override void Load() { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Expected O, but got Unknown Log = ((BasePlugin)this).Log; Log.LogInfo((object)"BigWalkBeaconMod v1.2 loaded."); Log.LogInfo((object)"Press 9 to toggle beacons on nearby dropped items."); Log.LogInfo((object)"Press 0 to inspect the exact class names of the object you are looking at."); Log.LogInfo((object)"Press F8 to configure beacons."); Log.LogInfo((object)"Press F7 to dump the camera hierarchy (helps find the look script to disable while F8 is open)."); ClassInjector.RegisterTypeInIl2Cpp(); GameObject val = new GameObject("BeaconModUpdater"); Object.DontDestroyOnLoad((Object)(object)val); ((Object)val).hideFlags = (HideFlags)61; BeaconUpdater beaconUpdater = val.AddComponent(); beaconUpdater.SetupConfig(((BasePlugin)this).Config); } } public class BeaconUpdater : MonoBehaviour { private readonly List activeBeacons = new List(); private readonly List activeLights = new List(); private bool beaconsActive; private Material beamMaterial; private ConfigEntry configSearchRange; private ConfigEntry configMaxBeacons; private ConfigEntry configUseAnimation; private ConfigEntry configColorSpeed; private ConfigEntry configBeamWidth; private ConfigEntry configBeamHeight; private ConfigEntry configPaletteChoice; private ConfigEntry configLightRange; private ConfigEntry configLightIntensity; private ConfigEntry configEnableParticles; private ConfigEntry configParticleCount; private ConfigEntry configParticleSize; private ConfigEntry configParticleRiseSpeed; private ConfigEntry configParticleSpinSpeed; private ConfigEntry configLookScriptName; private Behaviour cachedLookScript; private string lookScriptStatus = ""; private string lastLoggedMenuError = null; private bool isMenuOpen = false; private Vector2 scrollPos = Vector2.zero; private Rect windowRect = new Rect(20f, 20f, 340f, 500f); private CursorLockMode previousLockState; private bool previousCursorVisible; public BeaconUpdater(IntPtr ptr) : base(ptr) { }//IL_0030: 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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) private void SetMenuOpen(bool open) { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) if (open == isMenuOpen) { return; } isMenuOpen = open; if (isMenuOpen) { previousLockState = Cursor.lockState; previousCursorVisible = Cursor.visible; Cursor.lockState = (CursorLockMode)0; Cursor.visible = true; ApplyLookScriptNow(); return; } Cursor.lockState = previousLockState; Cursor.visible = previousCursorVisible; if ((Object)(object)cachedLookScript != (Object)null) { cachedLookScript.enabled = true; cachedLookScript = null; } } private void ApplyLookScriptNow() { //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Expected O, but got Unknown try { if ((Object)(object)cachedLookScript != (Object)null) { cachedLookScript.enabled = true; cachedLookScript = null; } if (string.IsNullOrEmpty(configLookScriptName.Value)) { lookScriptStatus = "No script name set yet - camera will keep moving while this menu is open."; return; } Behaviour val = FindBehaviourByTypeName(configLookScriptName.Value); if ((Object)(object)val != (Object)null) { val.enabled = false; cachedLookScript = val; lookScriptStatus = "Disabled '" + configLookScriptName.Value + "' - try moving the mouse now."; } else { lookScriptStatus = "Not found: '" + configLookScriptName.Value + "'. Check the F7 dump for the exact class name."; } } catch (Exception ex) { lookScriptStatus = "Error while searching: " + ex.Message; ManualLogSource log = BeaconModPlugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(45, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[BeaconMod] Exception in ApplyLookScriptNow: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex); } log.LogError(val2); } } private Behaviour FindBehaviourByTypeName(string typeName) { Transform playerTransform = GetPlayerTransform(); if ((Object)(object)playerTransform == (Object)null) { return null; } Transform val = (((Object)(object)playerTransform.root != (Object)null) ? playerTransform.root : playerTransform); Il2CppArrayBase componentsInChildren = ((Component)val).GetComponentsInChildren(true); foreach (Component item in componentsInChildren) { if (!((Object)(object)item == (Object)null)) { string name; try { name = ((MemberInfo)((Object)item).GetIl2CppType()).Name; } catch { continue; } if (name == typeName) { return ((Il2CppObjectBase)item).TryCast(); } } } return null; } private void DumpCameraHierarchy() { //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Expected O, but got Unknown //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Expected O, but got Unknown //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Expected O, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Expected O, but got Unknown //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Expected O, but got Unknown bool flag = default(bool); try { if ((Object)(object)Camera.main == (Object)null) { BeaconModPlugin.Log.LogWarning((object)"No main camera found."); return; } BeaconModPlugin.Log.LogInfo((object)"=== CAMERA HIERARCHY DUMP ==="); Transform val = ((Component)Camera.main).transform; int num = 0; while ((Object)(object)val != (Object)null && num < 50) { num++; ManualLogSource log = BeaconModPlugin.Log; BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(18, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("-- GameObject: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(((Object)val).name); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" --"); } log.LogInfo(val2); Component[] array; try { array = Il2CppArrayBase.op_Implicit(((Component)val).GetComponents()); } catch (Exception ex) { ManualLogSource log2 = BeaconModPlugin.Log; BepInExWarningLogInterpolatedStringHandler val3 = new BepInExWarningLogInterpolatedStringHandler(37, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" (could not read components here: "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(ex.Message); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(")"); } log2.LogWarning(val3); val = val.parent; continue; } Component[] array2 = array; foreach (Component val4 in array2) { if ((Object)(object)val4 == (Object)null) { continue; } try { ManualLogSource log3 = BeaconModPlugin.Log; val2 = new BepInExInfoLogInterpolatedStringHandler(13, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(((MemberInfo)((Object)val4).GetIl2CppType()).Name); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" (full: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(((Object)val4).GetIl2CppType().FullName); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(")"); } log3.LogInfo(val2); } catch (Exception ex2) { ManualLogSource log4 = BeaconModPlugin.Log; BepInExWarningLogInterpolatedStringHandler val3 = new BepInExWarningLogInterpolatedStringHandler(27, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" (unreadable component: "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(ex2.Message); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(")"); } log4.LogWarning(val3); } } val = val.parent; } BeaconModPlugin.Log.LogInfo((object)"=== END DUMP === Look for a script name with 'Look', 'Mouse', 'Cam', or 'FirstPerson' in it."); } catch (Exception ex3) { ManualLogSource log5 = BeaconModPlugin.Log; BepInExErrorLogInterpolatedStringHandler val5 = new BepInExErrorLogInterpolatedStringHandler(46, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val5).AppendLiteral("[BeaconMod] Exception in DumpCameraHierarchy: "); ((BepInExLogInterpolatedStringHandler)val5).AppendFormatted(ex3); } log5.LogError(val5); } } public void SetupConfig(ConfigFile config) { configSearchRange = config.Bind("Detection", "SearchRange", 40f, "Radius (meters) to scan for nearby small objects when beacons are turned on. Applies next time you press 9."); configMaxBeacons = config.Bind("Detection", "MaxBeacons", 15, "Maximum number of beacons active at once (higher = more lag risk). Applies next time you press 9."); configUseAnimation = config.Bind("Beam", "UseAnimation", true, "Enable or disable the pulsing/shimmering beam animation."); configBeamWidth = config.Bind("Beam", "BeamWidth", 0.12f, "Base thickness of the beacon beams."); configBeamHeight = config.Bind("Beam", "BeamHeight", 5000f, "How tall each beam extends into the sky."); configColorSpeed = config.Bind("Beam", "ColorSpeed", 0.1f, "Speed of the palette color rotation (Waluigi Cycle mode only)."); configPaletteChoice = config.Bind("Beam", "PaletteChoice", 0, "0 = Waluigi Cycle, 1 = Solid Purple, 2 = Solid Gold."); configLightRange = config.Bind("Light", "LightRange", 6f, "How far the glow at the base of each beacon reaches."); configLightIntensity = config.Bind("Light", "LightIntensity", 0.7f, "Brightness of the glow at the base of each beacon."); configEnableParticles = config.Bind("Particles", "EnableParticles", true, "Toggle the swirling particle effect around each beam."); configParticleCount = config.Bind("Particles", "ParticleCount", 6, "How many particles swirl around each beam. Applies next time you press 9."); configParticleSize = config.Bind("Particles", "ParticleSize", 0.08f, "Size of each swirling particle."); configParticleRiseSpeed = config.Bind("Particles", "ParticleRiseSpeed", 0.5f, "How fast particles float upward before looping back to the base."); configParticleSpinSpeed = config.Bind("Particles", "ParticleSpinSpeed", 1f, "How fast particles orbit around the beam."); configLookScriptName = config.Bind("Menu", "LookScriptTypeName", "", "Exact class name (not full namespace, just the class name, e.g. 'PlayerLook') of the script that rotates the camera. Press F7 in-game to dump every component near the camera and find it. Leave blank to skip auto-disabling camera look while the F8 menu is open."); } public void OnGUI() { //IL_0017: 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) if (isMenuOpen) { windowRect = GUILayout.Window(999, windowRect, WindowFunction.op_Implicit((Action)DrawMenuWindow), "Beacon Mod Settings (F8)", (Il2CppReferenceArray)null); } } private void DrawMenuWindow(int windowID) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Expected O, but got Unknown //IL_00cc: Unknown result type (might be due to invalid IL or missing references) scrollPos = GUILayout.BeginScrollView(scrollPos, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(320f), GUILayout.Height(430f) }); try { DrawMenuContents(); } catch (Exception ex) { GUILayout.Label("UI error: " + ex.Message, (Il2CppReferenceArray)null); if (lastLoggedMenuError != ex.Message) { lastLoggedMenuError = ex.Message; ManualLogSource log = BeaconModPlugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(40, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[BeaconMod] Exception building F8 menu: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex); } log.LogError(val); } } finally { GUILayout.EndScrollView(); } GUI.DragWindow(new Rect(0f, 0f, 10000f, 20f)); } private void DrawMenuContents() { GUILayout.Label("— Detection —", (Il2CppReferenceArray)null); GUILayout.Label($"Search Range: {configSearchRange.Value:F0}m", (Il2CppReferenceArray)null); configSearchRange.Value = GUILayout.HorizontalSlider(configSearchRange.Value, 5f, 150f, Array.Empty()); GUILayout.Label($"Max Beacons: {configMaxBeacons.Value}", (Il2CppReferenceArray)null); configMaxBeacons.Value = Mathf.RoundToInt(GUILayout.HorizontalSlider((float)configMaxBeacons.Value, 1f, 40f, Array.Empty())); GUILayout.Space(12f); GUILayout.Label("— Beam —", (Il2CppReferenceArray)null); configUseAnimation.Value = GUILayout.Toggle(configUseAnimation.Value, " Enable Shimmer Animation", Array.Empty()); GUILayout.Label($"Beam Base Thickness: {configBeamWidth.Value:F2}", (Il2CppReferenceArray)null); configBeamWidth.Value = GUILayout.HorizontalSlider(configBeamWidth.Value, 0.02f, 1f, Array.Empty()); GUILayout.Label($"Beam Height: {configBeamHeight.Value:F0}", (Il2CppReferenceArray)null); configBeamHeight.Value = GUILayout.HorizontalSlider(configBeamHeight.Value, 10f, 5000f, Array.Empty()); GUILayout.Label($"Color Shift Speed: {configColorSpeed.Value:F2}", (Il2CppReferenceArray)null); configColorSpeed.Value = GUILayout.HorizontalSlider(configColorSpeed.Value, 0f, 2f, Array.Empty()); GUILayout.Label("Color Theme Mode:", (Il2CppReferenceArray)null); GUILayout.BeginHorizontal((Il2CppReferenceArray)null); if (GUILayout.Toggle(configPaletteChoice.Value == 0, "Waluigi Cycle", Array.Empty())) { configPaletteChoice.Value = 0; } if (GUILayout.Toggle(configPaletteChoice.Value == 1, "Solid Purple", Array.Empty())) { configPaletteChoice.Value = 1; } if (GUILayout.Toggle(configPaletteChoice.Value == 2, "Solid Gold", Array.Empty())) { configPaletteChoice.Value = 2; } GUILayout.EndHorizontal(); GUILayout.Space(12f); GUILayout.Label("— Light —", (Il2CppReferenceArray)null); GUILayout.Label($"Light Range: {configLightRange.Value:F1}", (Il2CppReferenceArray)null); configLightRange.Value = GUILayout.HorizontalSlider(configLightRange.Value, 1f, 20f, Array.Empty()); GUILayout.Label($"Light Intensity: {configLightIntensity.Value:F1}", (Il2CppReferenceArray)null); configLightIntensity.Value = GUILayout.HorizontalSlider(configLightIntensity.Value, 0f, 5f, Array.Empty()); GUILayout.Space(12f); GUILayout.Label("— Particles —", (Il2CppReferenceArray)null); configEnableParticles.Value = GUILayout.Toggle(configEnableParticles.Value, " Enable Swirling Particles", Array.Empty()); GUILayout.Label($"Particle Count: {configParticleCount.Value} (applies on next toggle)", (Il2CppReferenceArray)null); configParticleCount.Value = Mathf.RoundToInt(GUILayout.HorizontalSlider((float)configParticleCount.Value, 0f, 20f, Array.Empty())); GUILayout.Label($"Particle Size: {configParticleSize.Value:F2}", (Il2CppReferenceArray)null); configParticleSize.Value = GUILayout.HorizontalSlider(configParticleSize.Value, 0.02f, 0.3f, Array.Empty()); GUILayout.Label($"Particle Rise Speed: {configParticleRiseSpeed.Value:F2}", (Il2CppReferenceArray)null); configParticleRiseSpeed.Value = GUILayout.HorizontalSlider(configParticleRiseSpeed.Value, 0f, 3f, Array.Empty()); GUILayout.Label($"Particle Orbit Speed: {configParticleSpinSpeed.Value:F2}", (Il2CppReferenceArray)null); configParticleSpinSpeed.Value = GUILayout.HorizontalSlider(configParticleSpinSpeed.Value, 0f, 5f, Array.Empty()); GUILayout.Space(12f); GUILayout.Label("— Menu / Look Lock —", (Il2CppReferenceArray)null); GUILayout.Label("Camera look script class name (from F7 dump):", (Il2CppReferenceArray)null); configLookScriptName.Value = GUILayout.TextField(configLookScriptName.Value, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(280f) }); if (GUILayout.Button("Find & Disable Now", (Il2CppReferenceArray)null)) { ApplyLookScriptNow(); } if (!string.IsNullOrEmpty(lookScriptStatus)) { GUILayout.Label(lookScriptStatus, (Il2CppReferenceArray)null); } } public void Update() { if (Input.GetKeyDown((KeyCode)57) || Input.GetKeyDown((KeyCode)265)) { ToggleBeacons(); } if (Input.GetKeyDown((KeyCode)48) || Input.GetKeyDown((KeyCode)256)) { InspectObjectInFront(); } if (Input.GetKeyDown((KeyCode)289)) { SetMenuOpen(!isMenuOpen); } if (Input.GetKeyDown((KeyCode)288)) { DumpCameraHierarchy(); } if (beaconsActive) { AnimateBeacons(); } } private void AnimateBeacons() { //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_034c: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) Color val = default(Color); ((Color)(ref val))..ctor(0.494f, 0.047f, 0.839f, 0.6f); if (configPaletteChoice.Value == 0) { Color val2 = default(Color); ((Color)(ref val2))..ctor(0.494f, 0.047f, 0.839f, 0.6f); Color val3 = default(Color); ((Color)(ref val3))..ctor(1f, 0.85f, 0f, 0.6f); Color val4 = default(Color); ((Color)(ref val4))..ctor(1f, 1f, 1f, 0.6f); Color val5 = default(Color); ((Color)(ref val5))..ctor(0.05f, 0.1f, 0.45f, 0.6f); float num = Time.time * configColorSpeed.Value % 4f; val = ((num < 1f) ? Color.Lerp(val2, val3, num) : ((num < 2f) ? Color.Lerp(val3, val4, num - 1f) : ((!(num < 3f)) ? Color.Lerp(val5, val2, num - 3f) : Color.Lerp(val4, val5, num - 2f)))); } else if (configPaletteChoice.Value == 2) { ((Color)(ref val))..ctor(1f, 0.85f, 0f, 0.6f); } float num2 = 1f; float num3 = 1f; if (configUseAnimation.Value) { num2 = 1f + Mathf.Sin(Time.time * 1.2f) * 0.05f; num3 = 1f + Mathf.Cos(Time.time * 1.2f) * 0.05f; } float value = configBeamHeight.Value; float num4 = value / 2f; foreach (Transform activeBeacon in activeBeacons) { if (!((Object)(object)activeBeacon == (Object)null)) { activeBeacon.localPosition = new Vector3(0f, num4, 0f); float num5 = configBeamWidth.Value * num2; float num6 = configBeamWidth.Value * num3; activeBeacon.localScale = new Vector3(num5, value, num6); MeshRenderer component = ((Component)activeBeacon).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)((Renderer)component).material != (Object)null) { ((Renderer)component).material.color = val; ((Renderer)component).material.SetColor("_Color", val); ((Renderer)component).material.SetColor("_BaseColor", val); } if (configEnableParticles.Value && (Object)(object)activeBeacon.parent != (Object)null) { AnimateParticles(activeBeacon.parent, val); } } } foreach (Light activeLight in activeLights) { if (!((Object)(object)activeLight == (Object)null)) { activeLight.range = configLightRange.Value; activeLight.intensity = configLightIntensity.Value; activeLight.color = val; } } } private void AnimateParticles(Transform rootTransform, Color targetColor) { //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) int num = Mathf.Clamp(configParticleCount.Value, 0, 30); if (num <= 0) { return; } float value = configParticleRiseSpeed.Value; float num2 = 60f * configParticleSpinSpeed.Value; float num3 = 0.25f + configBeamWidth.Value; float value2 = configParticleSize.Value; for (int i = 0; i < num; i++) { Transform val = rootTransform.Find("[BeaconMod] Particle_" + i); if (!((Object)(object)val == (Object)null)) { float num4 = 360f / (float)num * (float)i + Time.time * num2; float num5 = num4 * ((float)Math.PI / 180f); Vector3 localPosition = val.localPosition; localPosition.x = Mathf.Cos(num5) * num3; localPosition.z = Mathf.Sin(num5) * num3; localPosition.y += value * Time.deltaTime; if (localPosition.y > 6f || localPosition.y < 0f) { localPosition.y = Random.Range(0.05f, 0.3f); } val.localPosition = localPosition; val.localScale = Vector3.one * value2; MeshRenderer component = ((Component)val).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)((Renderer)component).material != (Object)null) { ((Renderer)component).material.color = targetColor; ((Renderer)component).material.SetColor("_Color", targetColor); ((Renderer)component).material.SetColor("_BaseColor", targetColor); } } } } private void InspectObjectInFront() { //IL_0032: 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_004b: 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_0090: Expected O, but got Unknown //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Expected O, but got Unknown //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Expected O, but got Unknown //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Expected O, but got Unknown //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Expected O, but got Unknown //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Expected O, but got Unknown if ((Object)(object)Camera.main == (Object)null) { BeaconModPlugin.Log.LogWarning((object)"No main camera found."); return; } Ray val = default(Ray); ((Ray)(ref val))..ctor(((Component)Camera.main).transform.position, ((Component)Camera.main).transform.forward); RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, ref val2, 50f)) { GameObject gameObject = ((Component)((RaycastHit)(ref val2)).collider).gameObject; BeaconModPlugin.Log.LogInfo((object)"=== INSPECTING OBJECT ==="); ManualLogSource log = BeaconModPlugin.Log; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val3 = new BepInExInfoLogInterpolatedStringHandler(6, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("Name: "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(((Object)gameObject).name); } log.LogInfo(val3); ManualLogSource log2 = BeaconModPlugin.Log; val3 = new BepInExInfoLogInterpolatedStringHandler(5, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("Tag: "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(gameObject.tag); } log2.LogInfo(val3); ManualLogSource log3 = BeaconModPlugin.Log; val3 = new BepInExInfoLogInterpolatedStringHandler(7, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("Layer: "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(LayerMask.LayerToName(gameObject.layer)); } log3.LogInfo(val3); ManualLogSource log4 = BeaconModPlugin.Log; val3 = new BepInExInfoLogInterpolatedStringHandler(10, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("IsStatic: "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(gameObject.isStatic); } log4.LogInfo(val3); Il2CppArrayBase components = gameObject.GetComponents(); ManualLogSource log5 = BeaconModPlugin.Log; val3 = new BepInExInfoLogInterpolatedStringHandler(14, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("Components ("); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(components.Length); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("):"); } log5.LogInfo(val3); foreach (Component item in components) { if ((Object)(object)item != (Object)null) { ManualLogSource log6 = BeaconModPlugin.Log; val3 = new BepInExInfoLogInterpolatedStringHandler(4, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" - "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted(((Object)item).GetIl2CppType().FullName); } log6.LogInfo(val3); } } BeaconModPlugin.Log.LogInfo((object)"=== END INSPECT ==="); } else { BeaconModPlugin.Log.LogInfo((object)"Raycast hit nothing."); } } private void ToggleBeacons() { if (beaconsActive) { TurnOff(); } else { TurnOn(); } } private void TurnOn() { //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Expected O, but got Unknown Transform player = GetPlayerTransform(); if ((Object)(object)player == (Object)null) { BeaconModPlugin.Log.LogWarning((object)"Could not find player."); return; } List source = FindDroppedObjectsNear(player); int count = Mathf.Clamp(configMaxBeacons.Value, 1, 60); List list = source.OrderBy((GameObject obj) => Vector3.Distance(GetBeaconBasePosition(obj), player.position)).Take(count).ToList(); foreach (GameObject item in list) { CreateBeacon(item, GetBeaconBasePosition(item)); } beaconsActive = activeBeacons.Count > 0; if (beaconsActive) { ManualLogSource log = BeaconModPlugin.Log; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(19, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Turned on "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(activeBeacons.Count); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" beacons."); } log.LogInfo(val); } else { BeaconModPlugin.Log.LogInfo((object)"No valid small objects found nearby."); } } private void TurnOff() { foreach (Transform activeBeacon in activeBeacons) { if ((Object)(object)activeBeacon != (Object)null && (Object)(object)activeBeacon.parent != (Object)null) { Object.Destroy((Object)(object)((Component)activeBeacon.parent).gameObject); } } activeBeacons.Clear(); activeLights.Clear(); beaconsActive = false; BeaconModPlugin.Log.LogInfo((object)"Turned off."); } private List FindDroppedObjectsNear(Transform player) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) HashSet hashSet = new HashSet(); float value = configSearchRange.Value; Collider[] array = Il2CppArrayBase.op_Implicit((Il2CppArrayBase)(object)Physics.OverlapSphere(player.position, value, -1, (QueryTriggerInteraction)1)); Collider[] array2 = array; foreach (Collider val in array2) { if ((Object)(object)val == (Object)null) { continue; } GameObject val2 = (((Object)(object)val.attachedRigidbody != (Object)null) ? ((Component)val.attachedRigidbody).gameObject : ((Component)val).gameObject); if ((Object)(object)val2 == (Object)null || !val2.activeInHierarchy || IsBeaconObject(val2) || IsPlayerObject(val2, player) || val2.isStatic || (val2.tag == "Untagged" && ((object)val).GetType().Name.Contains("Terrain"))) { continue; } string name = ((Object)val2).name; if (!name.Contains("Spotlight") && !name.Contains("Spotlight_Lamp") && !name.Contains("Light") && !name.Contains("Endcap") && !name.Contains("board") && !name.Contains("FixedRadio_stand") && !name.Contains("SalonSwatch") && !name.Contains("Straight_Long_grateCol") && !name.Contains("Support_Light") && !name.Contains("Static")) { Vector3 approximateSize = GetApproximateSize(val2, val); if (!(((Vector3)(ref approximateSize)).magnitude > 2.5f) && !(approximateSize.x > 2f) && !(approximateSize.y > 2f) && !(approximateSize.z > 2f) && !(Vector3.Distance(val2.transform.position, player.position) > value)) { hashSet.Add(val2); } } } return hashSet.ToList(); } private Transform GetPlayerTransform() { GameObject val = GameObject.FindGameObjectWithTag("Player"); if ((Object)(object)val != (Object)null) { return val.transform; } if ((Object)(object)Camera.main != (Object)null) { return ((Component)Camera.main).transform; } return null; } private bool IsPlayerObject(GameObject go, Transform player) { if ((Object)(object)go == (Object)null || (Object)(object)player == (Object)null) { return false; } if ((Object)(object)go.transform == (Object)(object)player || go.transform.IsChildOf(player)) { return true; } if (go.tag == "Player") { return true; } string text = ((Object)go).name.ToLowerInvariant(); return text.Contains("player") || text.Contains("character") || text.Contains("walker"); } private bool IsBeaconObject(GameObject go) { if ((Object)(object)go == (Object)null) { return false; } return ((Object)go).name.StartsWith("[BeaconMod]", StringComparison.OrdinalIgnoreCase); } private Vector3 GetApproximateSize(GameObject go, Collider fallbackCollider) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) Renderer componentInChildren = go.GetComponentInChildren(); Bounds bounds; if ((Object)(object)componentInChildren != (Object)null) { bounds = componentInChildren.bounds; return ((Bounds)(ref bounds)).size; } if ((Object)(object)fallbackCollider != (Object)null) { bounds = fallbackCollider.bounds; return ((Bounds)(ref bounds)).size; } return Vector3.one; } private Vector3 GetBeaconBasePosition(GameObject go) { //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_001d: 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_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: 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_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007f: 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_00a1: Unknown result type (might be due to invalid IL or missing references) Renderer componentInChildren = go.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { Bounds bounds = componentInChildren.bounds; return new Vector3(((Bounds)(ref bounds)).center.x, ((Bounds)(ref bounds)).min.y, ((Bounds)(ref bounds)).center.z); } Collider componentInChildren2 = go.GetComponentInChildren(); if ((Object)(object)componentInChildren2 != (Object)null) { Bounds bounds2 = componentInChildren2.bounds; return new Vector3(((Bounds)(ref bounds2)).center.x, ((Bounds)(ref bounds2)).min.y, ((Bounds)(ref bounds2)).center.z); } return go.transform.position; } private Material GetBeamMaterial() { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Expected O, but got Unknown //IL_009e: 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_00c2: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)beamMaterial != (Object)null) { return beamMaterial; } Shader val = Shader.Find("Universal Render Pipeline/Unlit") ?? Shader.Find("Unlit/Color") ?? Shader.Find("UI/Default") ?? Shader.Find("Sprites/Default") ?? Shader.Find("Legacy Shaders/Diffuse"); if ((Object)(object)val == (Object)null) { return null; } beamMaterial = new Material(val); Color val2 = default(Color); ((Color)(ref val2))..ctor(0.494f, 0.047f, 0.839f, 0.6f); beamMaterial.color = val2; beamMaterial.SetColor("_Color", val2); beamMaterial.SetColor("_BaseColor", val2); return beamMaterial; } private void CreateBeacon(GameObject target, Vector3 basePosition) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Expected O, but got Unknown //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("[BeaconMod] Beacon"); val.transform.position = basePosition; val.transform.rotation = Quaternion.identity; GameObject val2 = GameObject.CreatePrimitive((PrimitiveType)2); ((Object)val2).name = "[BeaconMod] Beam"; val2.transform.SetParent(val.transform, false); val2.transform.localPosition = new Vector3(0f, 30f, 0f); val2.transform.localScale = new Vector3(0.1f, 30f, 0.1f); Collider component = val2.GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } MeshRenderer component2 = val2.GetComponent(); if ((Object)(object)component2 != (Object)null) { Material val3 = GetBeamMaterial(); if ((Object)(object)val3 != (Object)null) { ((Renderer)component2).material = val3; } else { ((Renderer)component2).material.color = new Color(0.494f, 0.047f, 0.839f, 1f); } ((Renderer)component2).shadowCastingMode = (ShadowCastingMode)0; } GameObject val4 = new GameObject("[BeaconMod] Light"); val4.transform.SetParent(val.transform, false); val4.transform.localPosition = new Vector3(0f, 1f, 0f); Light val5 = val4.AddComponent(); val5.type = (LightType)2; val5.color = new Color(0.494f, 0.047f, 0.839f, 1f); val5.range = configLightRange.Value; val5.intensity = configLightIntensity.Value; val5.shadows = (LightShadows)0; activeBeacons.Add(val2.transform); activeLights.Add(val5); if (!configEnableParticles.Value) { return; } int num = Mathf.Clamp(configParticleCount.Value, 0, 30); for (int i = 0; i < num; i++) { GameObject val6 = GameObject.CreatePrimitive((PrimitiveType)0); ((Object)val6).name = "[BeaconMod] Particle_" + i; val6.transform.SetParent(val.transform, false); val6.transform.localScale = Vector3.one * configParticleSize.Value; val6.transform.localPosition = new Vector3(0f, Random.Range(0.1f, 5f), 0f); Collider component3 = val6.GetComponent(); if ((Object)(object)component3 != (Object)null) { Object.Destroy((Object)(object)component3); } MeshRenderer component4 = val6.GetComponent(); if ((Object)(object)component4 != (Object)null) { Material val7 = GetBeamMaterial(); if ((Object)(object)val7 != (Object)null) { ((Renderer)component4).material = val7; } ((Renderer)component4).shadowCastingMode = (ShadowCastingMode)0; } } } } }