using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using LethalCompanyInputUtils.Api; using LethalConfig; using LethalConfig.ConfigItems; using LethalConfig.ConfigItems.Options; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.Rendering; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyCompany("LeadMeOut")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("2.0.1.0")] [assembly: AssemblyInformationalVersion("2.0.1")] [assembly: AssemblyProduct("LeadMeOut")] [assembly: AssemblyTitle("LeadMeOut")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("2.0.1.0")] [module: UnverifiableCode] namespace LeadMeOut; public class ExitFinder { private struct PathResult { public List Points; public bool IsLockedDoor; public bool IsDeadEnd; public bool IsDoorBlocked; } private class DoorEdge { public DoorLock door; public Vector3 center; public Vector3 sideA; public Vector3 sideB; public int regionA = -1; public int regionB = -1; } private class SidePoint { public Vector3 pos; public int region = -1; public DoorEdge owner; public bool isSideA; } private struct DoorwayCrossing { public int seg; public float t; public Vector3 centre; public Vector3 dir; } private bool isActive; private Transform mainEntranceTarget; private Transform mineshaftBottomTarget; private Transform mineshaftTopTarget; private Transform realMainEntrance; private List fireExitTargets = new List(); private readonly NavMeshPath scratchPath = new NavMeshPath(); private readonly NavMeshPath scratchPathDoor = new NavMeshPath(); private readonly NavMeshPath scratchPathReach = new NavMeshPath(); private List mainEntranceSegments = new List(); private List mainEntranceDiamonds = new List(); private List mainEntranceShapes = new List(); private GameObject mainEntranceRoot; private GameObject mainEntranceMarker; private List> fireExitSegmentSets = new List>(); private List> fireExitDiamondSets = new List>(); private List> fireExitShapeSets = new List>(); private List fireExitRoots = new List(); private List fireExitMarkers = new List(); private GameObject compassOverlayRoot; private RectTransform mainEntrancePip; private RectTransform fireExitPip; private float updateTimer = 999f; private float pulseTimer; private bool wasInsideFactory; private float doorSimTimer = 999f; private const float DOOR_SIM_INTERVAL = 2f; private List<(DoorLock door, Collider col)> cachedLockedDoors; private float doorCacheTimer = 999f; private const float DOOR_CACHE_INTERVAL = 5f; private Vector3 smoothedPlayerPos = Vector3.zero; private bool smoothedPosInitialized; private float smoothSpeed = 8f; private int bezierSteps = 12; private NavigationMode lastNavMode; private const string COMPASS_PATH = "Systems/UI/Canvas/IngamePlayerHUD"; private const float COMPASS_WIDTH = 500f; private const float COMPASS_HEIGHT_UI = 36.39f; private const float COMPASS_ANCHOR_X = 0f; private const float COMPASS_ANCHOR_Y = -28f; private const float COMPASS_FOV = 240f; private const float COMPASS_VERTICAL_OFFSET = 12f; private const float COMPASS_FADE_ZONE = 0.15f; private const float COMPASS_HIDE_MARGIN = 5f; private List doorEdges = new List(); private List graphPoints = new List(); private List regionReps = new List(); private bool graphReady; private bool graphBuilding; private int graphPointIndex; private int graphRepIndex; private int graphLockSignature; private const int GRAPH_PATHFINDS_PER_TICK = 6; private const int GRAPH_MAX_DOORS = 64; private const float ELEVATOR_XZ_RADIUS = 10f; private Dictionary doorSimCache = new Dictionary(); private HashSet doorSimMisses = new HashSet(); private const float DOORWAY_HINT_RADIUS = 3f; private const float DOORWAY_STRAIGHT = 1f; private const float DOORWAY_CLEAR_RADIUS = 1.8f; private const float DOORWAY_MAX_SHIFT = 1.5f; private List<(DoorLock door, Collider col)> GetDoorCache() { if (cachedLockedDoors == null) { cachedLockedDoors = new List<(DoorLock, Collider)>(); DoorLock[] array = Object.FindObjectsOfType(); foreach (DoorLock val in array) { if (!((Object)(object)val == (Object)null)) { Collider componentInChildren = ((Component)val).GetComponentInChildren(); if (!((Object)(object)componentInChildren == (Object)null)) { cachedLockedDoors.Add((val, componentInChildren)); } } } Plugin.Logger.LogDebug((object)$"LeadMeOut: Door cache rebuilt — {cachedLockedDoors.Count} door(s) with colliders."); } return cachedLockedDoors; } public void Toggle() { PlayerControllerB localPlayer = GetLocalPlayer(); bool flag = (Object)(object)localPlayer != (Object)null && localPlayer.isInsideFactory; if (Plugin.AutoEnableOnEntry.Value && flag && isActive) { isActive = false; Plugin.Logger.LogInfo((object)"LeadMeOut: Temporarily disabled by hotkey."); ClearAll(); return; } if (!flag) { Plugin.Logger.LogInfo((object)"LeadMeOut: Not inside facility, ignoring toggle."); return; } isActive = !isActive; Plugin.Logger.LogInfo((object)("LeadMeOut: " + (isActive ? "ON" : "OFF"))); if (isActive) { smoothedPosInitialized = false; FindExits(); if (Plugin.NavMode.Value == NavigationMode.CompassMode) { CreateCompassOverlay(); } else { CreateLineRoots(); } } else { ClearAll(); } } public void Tick(float deltaTime) { //IL_00bd: 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) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: 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_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB localPlayer = GetLocalPlayer(); if ((Object)(object)localPlayer != (Object)null) { bool isInsideFactory = localPlayer.isInsideFactory; if (!wasInsideFactory && isInsideFactory && Plugin.AutoEnableOnEntry.Value && !isActive) { Plugin.Logger.LogInfo((object)"LeadMeOut: Auto-enabling on facility entry."); isActive = true; smoothedPosInitialized = false; FindExits(); if (Plugin.NavMode.Value == NavigationMode.CompassMode) { CreateCompassOverlay(); } else { CreateLineRoots(); } } if (wasInsideFactory && !isInsideFactory && isActive) { Plugin.Logger.LogInfo((object)"LeadMeOut: Player left facility, clearing."); isActive = false; ClearAll(); } wasInsideFactory = isInsideFactory; if (isActive) { Vector3 position = ((Component)localPlayer).transform.position; if (!smoothedPosInitialized) { smoothedPlayerPos = position; smoothedPosInitialized = true; } else { smoothedPlayerPos = Vector3.Lerp(smoothedPlayerPos, position, deltaTime * smoothSpeed); } } } if (isActive && Plugin.NavMode.Value != lastNavMode) { lastNavMode = Plugin.NavMode.Value; ClearAll(); FindExits(); if (lastNavMode == NavigationMode.CompassMode) { CreateCompassOverlay(); } else { CreateLineRoots(); } } MaintainDoorGraph(deltaTime); if (!isActive) { return; } pulseTimer += deltaTime; doorSimTimer += deltaTime; updateTimer += deltaTime; int num = Mathf.Clamp(Plugin.PathUpdateRate.Value, 1, 10); float num2 = 1f / (float)num; if (updateTimer >= num2) { updateTimer = 0f; Plugin.Logger.LogDebug((object)$"LeadMeOut: Tick mode={Plugin.NavMode.Value}"); if (Plugin.NavMode.Value == NavigationMode.CompassMode) { UpdateCompassOverlay(); } else { UpdatePaths(); } } } private void MaintainDoorGraph(float deltaTime) { doorCacheTimer += deltaTime; if (doorCacheTimer >= 5f) { doorCacheTimer = 0f; cachedLockedDoors = null; } if (GetDoorCache().Count == 0) { if (doorEdges.Count > 0) { ResetDoorGraph(); } graphLockSignature = 0; return; } int num = ComputeLockSignature(); if (num != graphLockSignature) { graphLockSignature = num; BeginDoorGraph(); } StepDoorGraph(); } private PlayerControllerB GetLocalPlayer() { GameNetworkManager instance = GameNetworkManager.Instance; if ((Object)(object)instance != (Object)null && (Object)(object)instance.localPlayerController != (Object)null) { return instance.localPlayerController; } return null; } private void FindExits() { //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: 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) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) mainEntranceTarget = null; fireExitTargets.Clear(); mineshaftBottomTarget = null; mineshaftTopTarget = null; realMainEntrance = null; Transform val = null; GameObject[] array = Object.FindObjectsOfType(); foreach (GameObject val2 in array) { if (((Object)val2).name.Contains("BottomElevatorPanel")) { Transform parent = val2.transform.parent; if ((Object)(object)parent != (Object)null && ((Object)parent).name.Contains("(Clone)")) { val = val2.transform; Plugin.Logger.LogInfo((object)$"LeadMeOut: BottomElevatorPanel (scene instance) found at {val2.transform.position}, parent={((Object)parent).name}"); break; } } } array = Object.FindObjectsOfType(); NavMeshHit val4 = default(NavMeshHit); foreach (GameObject val3 in array) { if (((Object)val3).name.Contains("EntranceTeleportA") && ((Object)val3).name.Contains("Clone")) { realMainEntrance = val3.transform; bool flag = false; if ((Object)(object)val != (Object)null) { bool flag2 = NavMesh.SamplePosition(val.position, ref val4, 4f, -1); bool flag3 = val.position.y < val3.transform.position.y - 4f; flag = flag2 && flag3; if (!flag) { Plugin.Logger.LogWarning((object)($"LeadMeOut: BottomElevatorPanel present but rejected (onNavMesh={flag2}, below={flag3}). " + "Treating as a normal (non-Mineshaft) interior.")); } } if (flag) { mineshaftBottomTarget = val; mineshaftTopTarget = val3.transform; mainEntranceTarget = val; Plugin.Logger.LogInfo((object)$"LeadMeOut: Mineshaft mode — bottom={val.position} top={val3.transform.position}"); } else { mainEntranceTarget = val3.transform; Plugin.Logger.LogInfo((object)$"LeadMeOut: Main entrance at {val3.transform.position}"); } } if (((Object)val3).name.Contains("EntranceTeleportB") && ((Object)val3).name.Contains("Clone")) { fireExitTargets.Add(val3.transform); Plugin.Logger.LogInfo((object)$"LeadMeOut: Fire exit #{fireExitTargets.Count} at {val3.transform.position}"); } } Plugin.Logger.LogInfo((object)$"LeadMeOut: Found {fireExitTargets.Count} fire exit(s)."); } private void CreateCompassOverlay() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: 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_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) ClearCompassOverlay(); GameObject val = GameObject.Find("Systems/UI/Canvas/IngamePlayerHUD"); if ((Object)(object)val == (Object)null) { Plugin.Logger.LogInfo((object)"LeadMeOut: Could not find HUD canvas path."); return; } compassOverlayRoot = new GameObject("LeadMeOut_CompassOverlay"); compassOverlayRoot.transform.SetParent(val.transform, false); compassOverlayRoot.AddComponent(); RectTransform obj = compassOverlayRoot.AddComponent(); obj.anchorMin = new Vector2(0.5f, 0f); obj.anchorMax = new Vector2(0.5f, 0f); obj.anchoredPosition = new Vector2(0f, 20.39f); obj.sizeDelta = new Vector2(500f, 36.39f); compassOverlayRoot.transform.SetAsLastSibling(); ShowLinesPreset value = Plugin.ShowLines.Value; if ((Object)(object)mainEntranceTarget != (Object)null && value != ShowLinesPreset.FireExitsOnly) { Color color = Plugin.ApplyBrightness(Plugin.ResolveColor(Plugin.MainEntranceColorPreset.Value, Plugin.MainEntranceCustomColor.Value, Color.green)); float width = Plugin.ResolvePipWidth(Plugin.MainEntranceLineWidth.Value); mainEntrancePip = CreatePip(compassOverlayRoot, color, width); } if (fireExitTargets.Count > 0 && value != ShowLinesPreset.MainEntranceOnly) { Color color2 = Plugin.ApplyBrightness(Plugin.ResolveColor(Plugin.FireExitColorPreset.Value, Plugin.FireExitCustomColor.Value, Color.red)); float width2 = Plugin.ResolvePipWidth(Plugin.FireExitLineWidth.Value); fireExitPip = CreatePip(compassOverlayRoot, color2, width2); } RectTransform component = compassOverlayRoot.GetComponent(); Plugin.Logger.LogInfo((object)$"LeadMeOut: Compass overlay created. Parent={((Object)val).name} anchorPos={component.anchoredPosition} size={component.sizeDelta} siblingIndex={compassOverlayRoot.transform.GetSiblingIndex()}"); } private RectTransform CreatePip(GameObject parent, Color color, float width) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_002a: 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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_007e: 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) GameObject val = new GameObject("Pip"); val.transform.SetParent(parent.transform, false); RectTransform obj = val.AddComponent(); obj.sizeDelta = new Vector2(width, 18f); obj.anchorMin = new Vector2(0.5f, 0.5f); obj.anchorMax = new Vector2(0.5f, 0.5f); obj.pivot = new Vector2(0.5f, 0.5f); obj.anchoredPosition = new Vector2(0f, 0f); ((Graphic)val.AddComponent()).color = color; Plugin.Logger.LogDebug((object)"LeadMeOut: Pip created as Image"); return obj; } private void UpdateCompassOverlay() { //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: 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) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: 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) //IL_01d8: 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_0203: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_0385: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Unknown result type (might be due to invalid IL or missing references) //IL_034f: Unknown result type (might be due to invalid IL or missing references) //IL_0354: Unknown result type (might be due to invalid IL or missing references) //IL_035b: Unknown result type (might be due to invalid IL or missing references) //IL_0360: Unknown result type (might be due to invalid IL or missing references) //IL_0399: Unknown result type (might be due to invalid IL or missing references) //IL_039e: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)compassOverlayRoot == (Object)null) { return; } PlayerControllerB localPlayer = GetLocalPlayer(); if ((Object)(object)localPlayer == (Object)null) { return; } if ((Object)(object)mineshaftBottomTarget != (Object)null && (Object)(object)mineshaftTopTarget != (Object)null && TryGetPosition(mineshaftTopTarget, out var pos)) { float y = ((Component)localPlayer).transform.position.y; float y2 = pos.y; mainEntranceTarget = ((y >= y2 - 8f) ? mineshaftTopTarget : mineshaftBottomTarget); } Transform val = ((Component)localPlayer).transform.Find("ScavengerModel/metarig/CameraContainer"); float num = (((Object)(object)val != (Object)null) ? val.eulerAngles.y : ((Component)localPlayer).transform.eulerAngles.y); Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(Mathf.Sin(num * ((float)Math.PI / 180f)), 0f, Mathf.Cos(num * ((float)Math.PI / 180f))); ShowLinesPreset value = Plugin.ShowLines.Value; Plugin.Logger.LogDebug((object)$"LeadMeOut: UpdateCompass - forward={val2}, mainPip={(Object)(object)mainEntrancePip != (Object)null}, firePip={(Object)(object)fireExitPip != (Object)null}, mainTarget={(Object)(object)mainEntranceTarget != (Object)null}, fireCount={fireExitTargets.Count}, showLines={Plugin.ShowLines.Value}"); if ((Object)(object)mainEntrancePip != (Object)null && TryGetPosition(mainEntranceTarget, out var pos2)) { ((Component)mainEntrancePip).gameObject.SetActive(value != ShowLinesPreset.FireExitsOnly); if (value != ShowLinesPreset.FireExitsOnly) { Color color = Plugin.ApplyBrightness(Plugin.ResolveColor(Plugin.MainEntranceColorPreset.Value, Plugin.MainEntranceCustomColor.Value, Color.green)); float num2 = Plugin.ResolvePipWidth(Plugin.MainEntranceLineWidth.Value); mainEntrancePip.sizeDelta = new Vector2(num2, mainEntrancePip.sizeDelta.y); Vector3 val3 = pos2; if ((Object)(object)mainEntranceTarget == (Object)(object)mineshaftBottomTarget) { val3 = ElevatorNudge(((Component)localPlayer).transform.position, val3, 1.8f); } UpdatePipPosition(mainEntrancePip, ((Component)localPlayer).transform.position, val3, val2, color); } } if ((Object)(object)fireExitPip != (Object)null && fireExitTargets.Count > 0) { ((Component)fireExitPip).gameObject.SetActive(value != ShowLinesPreset.MainEntranceOnly); if (value != ShowLinesPreset.MainEntranceOnly) { Color color2 = Plugin.ApplyBrightness(Plugin.ResolveColor(Plugin.FireExitColorPreset.Value, Plugin.FireExitCustomColor.Value, Color.red)); float num3 = Plugin.ResolvePipWidth(Plugin.FireExitLineWidth.Value); fireExitPip.sizeDelta = new Vector2(num3, fireExitPip.sizeDelta.y); UpdatePipPosition(targetPos: ((Object)(object)mineshaftBottomTarget != (Object)null && TryGetPosition(mineshaftTopTarget, out var pos3) && ((Component)localPlayer).transform.position.y >= pos3.y - 8f && TryGetPosition(mineshaftBottomTarget, out var pos4)) ? ElevatorNudge(((Component)localPlayer).transform.position, pos4, 2.2f) : ((!TryGetPosition(fireExitTargets[0], out var pos5)) ? ((Component)localPlayer).transform.position : pos5), pip: fireExitPip, playerPos: ((Component)localPlayer).transform.position, forward: val2, color: color2); } } } private void UpdatePipPosition(RectTransform pip, Vector3 playerPos, Vector3 targetPos, Vector3 forward, Color color) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: 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_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) try { Vector3 val = targetPos - playerPos; val.y = 0f; if (((Vector3)(ref val)).magnitude < 0.01f) { return; } ((Vector3)(ref val)).Normalize(); float num = Vector3.SignedAngle(forward, val, Vector3.up); float num2 = 120f; float num3 = Mathf.Abs(num); if (num3 > num2 + 5f) { ((Component)pip).gameObject.SetActive(false); return; } ((Component)pip).gameObject.SetActive(true); float num4 = Mathf.Clamp(num, 0f - num2, num2) / num2 * 250f; pip.anchoredPosition = new Vector2(num4, 0f); float num5 = 1f; float num6 = num3 / num2; float num7 = 0.85f; if (num6 > num7) { num5 = Mathf.Clamp01(Mathf.InverseLerp(1f, num7, num6)); } Plugin.Logger.LogDebug((object)$"LeadMeOut: PipPos angle={num:F1} xPos={num4:F1} alpha={num5:F2} active={((Component)pip).gameObject.activeSelf}"); Image componentInChildren = ((Component)pip).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { Color color2 = color; color2.a = num5; ((Graphic)componentInChildren).color = color2; } } catch (Exception ex) { Plugin.Logger.LogInfo((object)("LeadMeOut: PipPos exception: " + ex.Message)); } } private void ClearCompassOverlay() { if ((Object)(object)compassOverlayRoot != (Object)null) { Object.Destroy((Object)(object)compassOverlayRoot); compassOverlayRoot = null; } mainEntrancePip = null; fireExitPip = null; } private void CreateLineRoots() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Expected O, but got Unknown ClearLineRoots(); ShowLinesPreset value = Plugin.ShowLines.Value; if ((Object)(object)mainEntranceTarget != (Object)null && value != ShowLinesPreset.FireExitsOnly) { mainEntranceRoot = new GameObject("LeadMeOut_MainLine"); Object.DontDestroyOnLoad((Object)(object)mainEntranceRoot); } if (value != ShowLinesPreset.MainEntranceOnly) { for (int i = 0; i < fireExitTargets.Count; i++) { GameObject val = new GameObject($"LeadMeOut_FireLine_{i}"); Object.DontDestroyOnLoad((Object)(object)val); fireExitRoots.Add(val); fireExitSegmentSets.Add(new List()); fireExitDiamondSets.Add(new List()); fireExitShapeSets.Add(new List()); } } updateTimer = 999f; } private static bool TryGetPosition(Transform t, out Vector3 pos) { //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_0019: 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) pos = Vector3.zero; if ((Object)(object)t == (Object)null) { return false; } try { pos = t.position; return true; } catch (MissingReferenceException) { return false; } catch (NullReferenceException) { return false; } } private void UpdatePaths() { //IL_0041: 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_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_012e: 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) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: 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_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_03b7: Unknown result type (might be due to invalid IL or missing references) //IL_03bc: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Unknown result type (might be due to invalid IL or missing references) //IL_048e: Unknown result type (might be due to invalid IL or missing references) //IL_047c: Unknown result type (might be due to invalid IL or missing references) //IL_0487: Unknown result type (might be due to invalid IL or missing references) //IL_0490: Unknown result type (might be due to invalid IL or missing references) //IL_049c: Unknown result type (might be due to invalid IL or missing references) //IL_04a1: Unknown result type (might be due to invalid IL or missing references) //IL_04a8: Unknown result type (might be due to invalid IL or missing references) //IL_0496: Unknown result type (might be due to invalid IL or missing references) //IL_04ad: Unknown result type (might be due to invalid IL or missing references) //IL_04b7: Unknown result type (might be due to invalid IL or missing references) //IL_04b3: Unknown result type (might be due to invalid IL or missing references) //IL_04b9: Unknown result type (might be due to invalid IL or missing references) //IL_04bd: Unknown result type (might be due to invalid IL or missing references) //IL_04c2: Unknown result type (might be due to invalid IL or missing references) //IL_04c4: Unknown result type (might be due to invalid IL or missing references) //IL_0530: Unknown result type (might be due to invalid IL or missing references) //IL_053d: Unknown result type (might be due to invalid IL or missing references) //IL_058e: Unknown result type (might be due to invalid IL or missing references) //IL_0593: Unknown result type (might be due to invalid IL or missing references) //IL_0658: Unknown result type (might be due to invalid IL or missing references) //IL_05a2: Unknown result type (might be due to invalid IL or missing references) //IL_05a7: Unknown result type (might be due to invalid IL or missing references) //IL_05d9: Unknown result type (might be due to invalid IL or missing references) if (!smoothedPosInitialized) { return; } if ((Object)(object)mineshaftBottomTarget != (Object)null && (Object)(object)mineshaftTopTarget != (Object)null && TryGetPosition(mineshaftTopTarget, out var pos)) { float y = smoothedPlayerPos.y; float y2 = pos.y; mainEntranceTarget = ((y >= y2 - 8f) ? mineshaftTopTarget : mineshaftBottomTarget); } if (!TryGetPosition(mainEntranceTarget, out var pos2)) { if ((Object)(object)mainEntranceRoot != (Object)null) { mainEntranceRoot.SetActive(false); } mainEntranceTarget = null; } bool flag = (Object)(object)mineshaftBottomTarget != (Object)null && (Object)(object)mainEntranceTarget == (Object)(object)mineshaftBottomTarget; if (flag) { pos2 = ElevatorNudge(smoothedPlayerPos, pos2, 1.8f); } ShowLinesPreset value = Plugin.ShowLines.Value; Color color = Plugin.ResolveColor(Plugin.MainEntranceColorPreset.Value, Plugin.MainEntranceCustomColor.Value, Color.green); LineStyle value2 = Plugin.MainEntranceLineStyle.Value; float width = Plugin.ResolveWidth(Plugin.MainEntranceLineWidth.Value); Color val = Plugin.ResolveColor(Plugin.FireExitColorPreset.Value, Plugin.FireExitCustomColor.Value, Color.red); LineStyle value3 = Plugin.FireExitLineStyle.Value; float width2 = Plugin.ResolveWidth(Plugin.FireExitLineWidth.Value); float num = 0.18f; if ((Object)(object)mainEntranceRoot != (Object)null && (Object)(object)mainEntranceTarget != (Object)null && value != ShowLinesPreset.FireExitsOnly) { mainEntranceRoot.SetActive(true); if (!TryGetPosition(mainEntranceTarget, out var pos3)) { pos3 = pos2; } PathResult? path = GetPath(smoothedPlayerPos, pos2, pos3); if (!path.HasValue && (Object)(object)mineshaftBottomTarget != (Object)null && (Object)(object)realMainEntrance != (Object)null && (Object)(object)mainEntranceTarget != (Object)(object)realMainEntrance) { Plugin.Logger.LogWarning((object)"LeadMeOut: mineshaft main path failed — falling back to the real entrance door."); pos2 = realMainEntrance.position; flag = false; path = GetPath(smoothedPlayerPos, pos2, realMainEntrance.position); } if (path.HasValue) { bool flag2 = LineEndsAtElevator(path.Value, flag); RenderPath(mainEntranceRoot, mainEntranceSegments, mainEntranceDiamonds, mainEntranceShapes, path.Value.Points, color, value2, width, 0f, 0f, pos2, path.Value.IsLockedDoor && !flag2); float brightness = ((path.Value.IsDeadEnd && !flag2) ? Mathf.Lerp(0.3f, 1f, Mathf.Sin(pulseTimer * 4f) * 0.5f + 0.5f) : 1f); mainEntranceMarker = UpdateDeadEndMarker(mainEntranceMarker, mainEntranceRoot, path.Value.IsDeadEnd || flag2, path.Value.Points, color, brightness, flag2); } else { HideSegments(mainEntranceSegments); HideShapes(mainEntranceShapes); if ((Object)(object)mainEntranceMarker != (Object)null) { mainEntranceMarker.SetActive(false); } } } else if ((Object)(object)mainEntranceRoot != (Object)null) { mainEntranceRoot.SetActive(false); } if (value != ShowLinesPreset.MainEntranceOnly) { Vector3 pos4; bool flag3 = (Object)(object)mineshaftBottomTarget != (Object)null && TryGetPosition(mineshaftTopTarget, out pos4) && smoothedPlayerPos.y >= pos4.y - 8f; Vector3 pos5 = Vector3.zero; if (flag3 && !TryGetPosition(mineshaftBottomTarget, out pos5)) { flag3 = false; } List list = new List(); for (int i = 0; i < fireExitTargets.Count && i < fireExitRoots.Count; i++) { if (!TryGetPosition(fireExitTargets[i], out var pos6) && !flag3) { if ((Object)(object)fireExitRoots[i] != (Object)null) { fireExitRoots[i].SetActive(false); } continue; } while (fireExitMarkers.Count <= i) { fireExitMarkers.Add(null); } fireExitRoots[i].SetActive(true); float lateralOffset = num * (float)(i + 1); Color color2 = ((i == 0) ? val : DarkenColor(val, 0.15f * (float)i)); Vector3 val2 = (flag3 ? ElevatorNudge(smoothedPlayerPos, pos5, 2.2f) : pos6); Vector3 value4 = (flag3 ? pos5 : pos6); PathResult? path2 = GetPath(smoothedPlayerPos, val2, value4); if (path2.HasValue) { bool flag4 = LineEndsAtElevator(path2.Value, flag3); RenderPath(fireExitRoots[i], fireExitSegmentSets[i], fireExitDiamondSets[i], fireExitShapeSets[i], path2.Value.Points, color2, value3, width2, lateralOffset, 0f, val2, path2.Value.IsLockedDoor && !flag4); bool flag5 = path2.Value.IsDeadEnd || flag4; if (flag5) { Vector3 val3 = path2.Value.Points[path2.Value.Points.Count - 1]; foreach (Vector3 item in list) { if (Vector3.Distance(item, val3) < 2f) { flag5 = false; break; } } if (flag5) { list.Add(val3); } } float brightness2 = ((path2.Value.IsDeadEnd && !flag4) ? Mathf.Lerp(0.3f, 1f, Mathf.Sin(pulseTimer * 4f) * 0.5f + 0.5f) : 1f); fireExitMarkers[i] = UpdateDeadEndMarker(fireExitMarkers[i], fireExitRoots[i], flag5, path2.Value.Points, color2, brightness2, flag4, lateralOffset); } else { HideSegments(fireExitSegmentSets[i]); HideShapes(fireExitShapeSets[i]); if (i < fireExitMarkers.Count && (Object)(object)fireExitMarkers[i] != (Object)null) { fireExitMarkers[i].SetActive(false); } } } return; } foreach (GameObject fireExitRoot in fireExitRoots) { if ((Object)(object)fireExitRoot != (Object)null) { fireExitRoot.SetActive(false); } } } private Color DarkenColor(Color c, float amount) { //IL_0000: 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_001a: 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_0085: 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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0062: 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) if (c.r < 0.05f && c.g < 0.05f && c.b < 0.05f) { return new Color(Mathf.Min(1f, c.r + amount), Mathf.Min(1f, c.g + amount), Mathf.Min(1f, c.b + amount), c.a); } return new Color(Mathf.Max(0f, c.r - amount), Mathf.Max(0f, c.g - amount), Mathf.Max(0f, c.b - amount), c.a); } private bool PathHitsWall(List corners, out Vector3 blockPoint, out int blockIndex) { //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_0043: 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_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) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0095: 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_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00de: 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_0112: 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_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) blockPoint = Vector3.zero; blockIndex = -1; int num = LayerMask.NameToLayer("Room"); if (num < 0) { return false; } int num2 = 1 << num; float[] array = new float[3] { 0.4f, 1f, 1.6f }; RaycastHit val8 = default(RaycastHit); for (int i = 1; i < corners.Count; i++) { Vector3 val = corners[i - 1]; Vector3 val2 = corners[i]; Vector3 val3 = val2 - val; val3.y = 0f; if (((Vector3)(ref val3)).magnitude < 0.05f) { continue; } int num3 = 0; RaycastHit val4 = default(RaycastHit); float[] array2 = array; Vector3 val7; foreach (float num4 in array2) { Vector3 val5 = val + Vector3.up * num4; Vector3 val6 = val2 + Vector3.up * num4; val7 = val6 - val5; Vector3 normalized = ((Vector3)(ref val7)).normalized; float num5 = Vector3.Distance(val5, val6); if (Physics.Raycast(val5, normalized, ref val8, num5, num2, (QueryTriggerInteraction)1)) { if (num3 == 0) { val4 = val8; } num3++; } } if (num3 == array.Length) { val7 = val2 - val; Vector3 normalized2 = ((Vector3)(ref val7)).normalized; blockPoint = ((RaycastHit)(ref val4)).point - normalized2 * 0.4f; blockPoint.y = val.y; blockIndex = i; return true; } } return false; } private PathResult? GetPath(Vector3 from, Vector3 to, Vector3? doorSimKey = null) { //IL_0000: 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_0020: 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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0084: 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_00a7: 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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_0400: Unknown result type (might be due to invalid IL or missing references) //IL_0405: Unknown result type (might be due to invalid IL or missing references) //IL_0411: Unknown result type (might be due to invalid IL or missing references) //IL_0423: Unknown result type (might be due to invalid IL or missing references) //IL_0424: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_023f: 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_024a: Unknown result type (might be due to invalid IL or missing references) //IL_024c: 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_0123: Unknown result type (might be due to invalid IL or missing references) //IL_04bf: Unknown result type (might be due to invalid IL or missing references) //IL_0438: Unknown result type (might be due to invalid IL or missing references) //IL_0432: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_014c: 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_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_044e: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_05be: Unknown result type (might be due to invalid IL or missing references) //IL_05c3: Unknown result type (might be due to invalid IL or missing references) //IL_05cd: Unknown result type (might be due to invalid IL or missing references) //IL_05d2: Unknown result type (might be due to invalid IL or missing references) //IL_0461: Unknown result type (might be due to invalid IL or missing references) //IL_0468: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_04ec: Unknown result type (might be due to invalid IL or missing references) //IL_04f1: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_060e: Unknown result type (might be due to invalid IL or missing references) //IL_0492: Unknown result type (might be due to invalid IL or missing references) //IL_0499: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_0529: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_03d0: Unknown result type (might be due to invalid IL or missing references) //IL_03d7: Unknown result type (might be due to invalid IL or missing references) //IL_03d9: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_0559: Unknown result type (might be due to invalid IL or missing references) //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_0569: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Unknown result type (might be due to invalid IL or missing references) //IL_0346: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Unknown result type (might be due to invalid IL or missing references) //IL_0376: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_03aa: Unknown result type (might be due to invalid IL or missing references) //IL_03af: Unknown result type (might be due to invalid IL or missing references) //IL_038e: Unknown result type (might be due to invalid IL or missing references) NavMeshHit val = default(NavMeshHit); bool num = NavMesh.SamplePosition(from, ref val, 15f, -1); NavMeshHit val2 = default(NavMeshHit); bool flag = NavMesh.SamplePosition(to, ref val2, 2f, -1); if (!flag) { flag = NavMesh.SamplePosition(to, ref val2, 5f, -1); } if (!flag) { flag = NavMesh.SamplePosition(to, ref val2, 15f, -1); } if (!flag) { flag = NavMesh.SamplePosition(to, ref val2, 30f, -1); } if (!flag) { flag = NavMesh.SamplePosition(to, ref val2, 50f, -1); } if (!num || !flag) { return null; } List list = new List(); list.Add(from); Vector3 val3 = ((NavMeshHit)(ref val)).position; bool flag2 = false; bool flag3 = false; bool flag4 = false; bool isDoorBlocked = false; NavMeshHit val8 = default(NavMeshHit); for (int i = 0; i < 3; i++) { NavMeshPath val4 = scratchPath; NavMesh.CalculatePath(val3, ((NavMeshHit)(ref val2)).position, -1, val4); Vector3[] corners; if ((int)val4.status == 0 && val4.corners.Length >= 2) { corners = val4.corners; foreach (Vector3 item in corners) { list.Add(item); } flag3 = true; break; } if (val4.corners.Length < 2) { if (i == 0 && FindNearestReachablePoint(((NavMeshHit)(ref val)).position, to, out var result)) { NavMeshPath val5 = scratchPathDoor; NavMesh.CalculatePath(((NavMeshHit)(ref val)).position, result, -1, val5); if ((int)val5.status == 0 && val5.corners.Length >= 2) { corners = val5.corners; foreach (Vector3 item2 in corners) { list.Add(item2); } flag3 = true; flag4 = true; Plugin.Logger.LogDebug((object)$"LeadMeOut: reached nearest point on player's island: {result} (door unreachable — separate NavMesh island)."); break; } } flag2 = true; break; } if (Vector3.Distance(val4.corners[val4.corners.Length - 1], ((NavMeshHit)(ref val2)).position) <= 1.5f) { corners = val4.corners; foreach (Vector3 item3 in corners) { list.Add(item3); } flag3 = true; break; } Vector3 position = ((NavMeshHit)(ref val2)).position; Vector3 val6 = val4.corners[val4.corners.Length - 1]; float num2 = Vector3.Distance(val3, position); float num3 = Vector3.Distance(val6, position); if (num3 > num2 + 3f) { flag2 = true; break; } corners = val4.corners; foreach (Vector3 item4 in corners) { list.Add(item4); } if (num3 >= num2) { flag2 = true; break; } Vector3 val7 = Vector3.zero; float num4 = num3; bool flag5 = false; for (int k = 0; k < 12; k++) { float num5 = (float)k * 30f * ((float)Math.PI / 180f); if (!NavMesh.SamplePosition(val6 + new Vector3(Mathf.Cos(num5), 0f, Mathf.Sin(num5)) * 2f, ref val8, 2f, -1) || Mathf.Abs(((NavMeshHit)(ref val8)).position.y - val6.y) > 1.5f) { continue; } float num6 = Vector3.Distance(((NavMeshHit)(ref val8)).position, position); if (!(num6 >= num4)) { if (SegmentCrossesLockedDoor(val6, ((NavMeshHit)(ref val8)).position, out var hitPoint)) { Plugin.Logger.LogDebug((object)$"LeadMeOut: hop rejected — would cross a locked door at {hitPoint}"); continue; } if (!HopCrossesSeamOnly(val6, ((NavMeshHit)(ref val8)).position)) { Plugin.Logger.LogDebug((object)$"LeadMeOut: hop rejected — gap to {((NavMeshHit)(ref val8)).position} is too wide to be a NavMesh seam (wall)."); continue; } num4 = num6; val7 = ((NavMeshHit)(ref val8)).position; flag5 = true; } } if (!flag5) { flag2 = true; flag4 = true; break; } list.Add(val7); val3 = val7; } if (!flag3 && !flag4) { flag2 = true; flag4 = true; } if (flag4) { Vector3 position2 = ((NavMeshHit)(ref val2)).position; Plugin.Logger.LogDebug((object)$"LeadMeOut: PATH DEAD-END — attempting door simulation for target {position2}"); if (FindBlockingDoorCached(from, position2, (Vector3)(((??)doorSimKey) ?? position2), out var doorPoint)) { NavMeshPath val9 = scratchPathDoor; NavMeshHit val10 = default(NavMeshHit); if (NavMesh.SamplePosition(doorPoint, ref val10, 3f, -1) && NavMesh.CalculatePath(((NavMeshHit)(ref val)).position, ((NavMeshHit)(ref val10)).position, -1, val9) && val9.corners.Length >= 2) { list = new List(val9.corners); list[0] = from; list.Add(doorPoint); flag2 = true; flag4 = true; isDoorBlocked = true; } } } if (list.Count < 2) { return null; } list[0] = from; if (!flag2 && PathCrossesLockedDoor(list, out var doorPoint2)) { int num7 = 0; float num8 = float.MaxValue; for (int l = 0; l < list.Count; l++) { float num9 = Vector3.Distance(list[l], doorPoint2); if (num9 < num8) { num8 = num9; num7 = l; } } List list2 = new List(); for (int m = 0; m <= num7; m++) { list2.Add(list[m]); } if (list2.Count > 0 && Vector3.Distance(list2[list2.Count - 1], doorPoint2) > 0.5f) { list2.Add(doorPoint2); } if (list2.Count >= 2) { list = list2; flag2 = true; flag4 = true; isDoorBlocked = true; } } Vector3[] collection = CenterCorners(list.ToArray()); HashSet pinned; List corners2 = SnapThroughDoorways(new List(collection), out pinned); List list3 = SmoothPath(corners2, pinned); for (int n = 0; n < list3.Count; n++) { list3[n] += Vector3.up * 0.1f; } float num10 = Plugin.ResolveRenderDistance(Plugin.RenderDistance.Value); if (num10 < float.MaxValue && !flag2) { list3 = CullByDistance(list3, from, num10); } if (list3.Count < 2) { return null; } return new PathResult { Points = list3, IsLockedDoor = flag2, IsDeadEnd = flag4, IsDoorBlocked = isDoorBlocked }; } private int ComputeLockSignature() { int num = 0; foreach (var item in GetDoorCache()) { if (!((Object)(object)item.door == (Object)null) && item.door.isLocked) { int instanceID = ((Object)item.door).GetInstanceID(); instanceID ^= instanceID >> 16; instanceID *= 73244475; instanceID ^= instanceID >> 16; num ^= instanceID; } } return num; } private void ResetDoorGraph() { doorEdges.Clear(); graphPoints.Clear(); regionReps.Clear(); graphReady = false; graphBuilding = false; graphPointIndex = 0; graphRepIndex = 0; } private void BeginDoorGraph() { //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0080: 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_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_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: 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_009d: 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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: 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_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: 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_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) ResetDoorGraph(); NavMeshHit val2 = default(NavMeshHit); NavMeshHit val3 = default(NavMeshHit); foreach (var item in GetDoorCache()) { if (doorEdges.Count >= 64) { break; } if (!((Object)(object)item.door == (Object)null) && !((Object)(object)item.col == (Object)null) && item.door.isLocked) { Bounds bounds = item.col.bounds; Vector3 center = ((Bounds)(ref bounds)).center; bounds = item.col.bounds; Vector3 extents = ((Bounds)(ref bounds)).extents; Vector3 val = ((extents.x < extents.z) ? Vector3.right : Vector3.forward); float num = Mathf.Min(extents.x, extents.z); if (NavMesh.SamplePosition(center + val * (num + 1.2f), ref val2, 2f, -1) && NavMesh.SamplePosition(center - val * (num + 1.2f), ref val3, 2f, -1)) { DoorEdge doorEdge = new DoorEdge { door = item.door, center = center, sideA = ((NavMeshHit)(ref val2)).position, sideB = ((NavMeshHit)(ref val3)).position }; doorEdges.Add(doorEdge); graphPoints.Add(new SidePoint { pos = doorEdge.sideA, owner = doorEdge, isSideA = true }); graphPoints.Add(new SidePoint { pos = doorEdge.sideB, owner = doorEdge, isSideA = false }); } } } graphBuilding = doorEdges.Count > 0; graphReady = doorEdges.Count == 0; Plugin.Logger.LogDebug((object)$"LeadMeOut: DoorGraph — build started: {doorEdges.Count} locked door(s), {graphPoints.Count} side point(s)."); } private void StepDoorGraph() { //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_0062: 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) if (!graphBuilding || graphReady) { return; } int num = 6; while (num > 0 && graphPointIndex < graphPoints.Count) { SidePoint sidePoint = graphPoints[graphPointIndex]; if (sidePoint.region >= 0) { graphPointIndex++; graphRepIndex = 0; } else if (graphRepIndex < regionReps.Count) { bool num2 = IsPathComplete(sidePoint.pos, regionReps[graphRepIndex]); num--; if (num2) { sidePoint.region = graphRepIndex; graphPointIndex++; graphRepIndex = 0; } else { graphRepIndex++; } } else { sidePoint.region = regionReps.Count; regionReps.Add(sidePoint.pos); graphPointIndex++; graphRepIndex = 0; } } if (graphPointIndex < graphPoints.Count) { return; } foreach (SidePoint graphPoint in graphPoints) { if (graphPoint.isSideA) { graphPoint.owner.regionA = graphPoint.region; } else { graphPoint.owner.regionB = graphPoint.region; } } graphReady = true; graphBuilding = false; doorSimCache.Clear(); doorSimMisses.Clear(); Plugin.Logger.LogInfo((object)$"LeadMeOut: DoorGraph — built: {doorEdges.Count} locked door(s) across {regionReps.Count} region(s)."); } private int RegionOf(Vector3 p) { //IL_0000: 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_0025: Unknown result type (might be due to invalid IL or missing references) NavMeshHit val = default(NavMeshHit); if (!NavMesh.SamplePosition(p, ref val, 5f, -1)) { return -1; } for (int i = 0; i < regionReps.Count; i++) { if (IsPathComplete(((NavMeshHit)(ref val)).position, regionReps[i])) { return i; } } return -1; } private bool FindBlockingDoorCached(Vector3 from, Vector3 to, Vector3 cacheKey, out Vector3 doorPoint) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: 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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0031: 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_006f: 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) doorPoint = Vector3.zero; if (doorSimTimer < 2f) { if (doorSimCache.TryGetValue(cacheKey, out doorPoint)) { return true; } if (doorSimMisses.Contains(cacheKey)) { return false; } } else { doorSimTimer = 0f; doorSimCache.Clear(); doorSimMisses.Clear(); } bool num = FindBlockingDoor(from, to, out doorPoint); if (num) { doorSimCache[cacheKey] = doorPoint; return num; } doorSimMisses.Add(cacheKey); return num; } private bool FindBlockingDoor(Vector3 from, Vector3 to, out Vector3 doorPoint) { //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_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_022e: 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) doorPoint = Vector3.zero; if (!graphReady) { Plugin.Logger.LogDebug((object)"LeadMeOut: DoorSim — region graph still building."); return false; } if (doorEdges.Count == 0) { return false; } int num = RegionOf(from); int num2 = RegionOf(to); Plugin.Logger.LogDebug((object)$"LeadMeOut: DoorSim — playerRegion={num} exitRegion={num2} (regions={regionReps.Count}, doors={doorEdges.Count})"); if (num < 0 || num2 < 0) { Plugin.Logger.LogDebug((object)"LeadMeOut: DoorSim — player or exit sits in no door-bounded region. Blockage is structural, not a door."); return false; } if (num == num2) { Plugin.Logger.LogDebug((object)"LeadMeOut: DoorSim — player and exit share a region. Blockage is not a door."); return false; } HashSet hashSet = new HashSet(); Dictionary dictionary = new Dictionary(); Dictionary dictionary2 = new Dictionary(); Queue queue = new Queue(); hashSet.Add(num); queue.Enqueue(num); bool flag = false; while (queue.Count > 0 && !flag) { int num3 = queue.Dequeue(); foreach (DoorEdge doorEdge2 in doorEdges) { if (doorEdge2.regionA < 0 || doorEdge2.regionB < 0 || doorEdge2.regionA == doorEdge2.regionB) { continue; } int num4; if (doorEdge2.regionA == num3) { num4 = doorEdge2.regionB; } else { if (doorEdge2.regionB != num3) { continue; } num4 = doorEdge2.regionA; } if (!hashSet.Contains(num4)) { hashSet.Add(num4); dictionary[num4] = doorEdge2; dictionary2[num4] = num3; queue.Enqueue(num4); if (num4 == num2) { flag = true; break; } } } } if (!flag) { Plugin.Logger.LogDebug((object)$"LeadMeOut: DoorSim — no chain of locked doors links region {num} to region {num2}."); return false; } int num5 = num2; DoorEdge doorEdge = null; int num6 = 0; while (num5 != num) { doorEdge = dictionary[num5]; num5 = dictionary2[num5]; num6++; } if (doorEdge == null) { return false; } doorPoint = doorEdge.center; Plugin.Logger.LogInfo((object)$"LeadMeOut: >>> BLOCKING DOOR at {doorPoint} — first of {num6} locked door(s) between you and this exit."); return true; } private float ClosestReachableDistanceTo(Vector3 from, Vector3 to) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0062: 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) NavMeshHit val = default(NavMeshHit); if (!NavMesh.SamplePosition(from, ref val, 3f, -1)) { return float.MaxValue; } NavMeshHit val2 = default(NavMeshHit); if (!NavMesh.SamplePosition(to, ref val2, 5f, -1)) { return float.MaxValue; } NavMeshPath val3 = scratchPathReach; NavMesh.CalculatePath(((NavMeshHit)(ref val)).position, ((NavMeshHit)(ref val2)).position, -1, val3); if ((int)val3.status == 0) { return 0f; } if (val3.corners.Length == 0) { return Vector3.Distance(((NavMeshHit)(ref val)).position, ((NavMeshHit)(ref val2)).position); } return Vector3.Distance(val3.corners[val3.corners.Length - 1], ((NavMeshHit)(ref val2)).position); } private bool IsPathComplete(Vector3 a, Vector3 b) { //IL_0007: 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) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Invalid comparison between Unknown and I4 NavMeshPath val = scratchPathReach; if (!NavMesh.CalculatePath(a, b, -1, val)) { return false; } return (int)val.status == 0; } private bool HopCrossesSeamOnly(Vector3 a, Vector3 b) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: 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_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_0031: 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_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) Vector3 val = b - a; float magnitude = ((Vector3)(ref val)).magnitude; if (magnitude < 0.001f) { return true; } Vector3 val2 = val / magnitude; float num = 0f; NavMeshHit val3 = default(NavMeshHit); for (float num2 = 0f; num2 <= magnitude; num2 += 0.1f) { if (NavMesh.SamplePosition(a + val2 * num2, ref val3, 0.25f, -1)) { num = 0f; continue; } num += 0.1f; if (num > 0.4f) { return false; } } return true; } private bool SegmentCrossesLockedDoor(Vector3 a, Vector3 b, out Vector3 hitPoint) { //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_000b: 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_000d: 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) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0095: 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) //IL_00b7: 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_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: 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_00cd: 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_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) hitPoint = Vector3.zero; Vector3 val = b - a; float magnitude = ((Vector3)(ref val)).magnitude; if (magnitude < 0.001f) { return false; } Vector3 val2 = val / magnitude; float num = default(float); foreach (var item in GetDoorCache()) { if (!((Object)(object)item.door == (Object)null) && !((Object)(object)item.col == (Object)null) && item.door.isLocked) { Bounds bounds = item.col.bounds; ((Bounds)(ref bounds)).Expand(new Vector3(0.4f, 1f, 0.4f)); if (((Bounds)(ref bounds)).Contains(a)) { hitPoint = a; return true; } if (((Bounds)(ref bounds)).IntersectRay(new Ray(a, val2), ref num) && num <= magnitude) { hitPoint = a + val2 * num; return true; } } } return false; } private bool PathCrossesLockedDoor(List corners, out Vector3 doorPoint) { //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_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) doorPoint = Vector3.zero; for (int i = 1; i < corners.Count; i++) { if (SegmentCrossesLockedDoor(corners[i - 1], corners[i], out doorPoint)) { Plugin.Logger.LogDebug((object)$"LeadMeOut: path runs THROUGH a locked door at {doorPoint} — truncating there."); return true; } } return false; } private float DistancePointToSegment(Vector3 p, Vector3 a, Vector3 b) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: 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_0037: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_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_0018: 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) Vector3 val = b - a; float magnitude = ((Vector3)(ref val)).magnitude; if (magnitude < 0.001f) { return Vector3.Distance(p, a); } float num = Mathf.Clamp01(Vector3.Dot(p - a, val) / (magnitude * magnitude)); Vector3 val2 = a + val * num; return Vector3.Distance(p, val2); } private List CullByDistance(List points, Vector3 origin, float maxDist) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0037: 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_005d: 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_0070: Unknown result type (might be due to invalid IL or missing references) List list = new List(); for (int i = 0; i < points.Count; i++) { float num = Vector3.Distance(origin, points[i]); if (num > maxDist) { if (i > 0) { float num2 = Vector3.Distance(origin, points[i - 1]); if (Vector3.Distance(points[i - 1], points[i]) > 0.001f) { float num3 = (maxDist - num2) / (num - num2); list.Add(Vector3.Lerp(points[i - 1], points[i], Mathf.Clamp01(num3))); } } break; } list.Add(points[i]); } return list; } private void RenderPath(GameObject root, List segments, List diamonds, List shapes, List points, Color color, LineStyle style, float width, float lateralOffset, float phaseOffset, Vector3 targetPos, bool isLockedDoor = false) { //IL_0035: 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_0047: 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_00a3: 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_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) if (isLockedDoor) { float num = Mathf.Sin(pulseTimer * 4f) * 0.5f + 0.5f; float num2 = Mathf.Lerp(0.3f, 1f, num); ((Color)(ref color))..ctor(color.r * num2, color.g * num2, color.b * num2, color.a); } if (lateralOffset != 0f) { points = ApplyLateralOffset(points, lateralOffset); } if (style == LineStyle.Arrow || style == LineStyle.Triangle || style == LineStyle.Diamond || style == LineStyle.Heart || style == LineStyle.Pawprint) { HideSegments(segments); HideSegments(diamonds); RenderShapes(root, shapes, points, color, style, width, targetPos); return; } HideShapes(shapes); float dashLength; float gapLength; if (style == LineStyle.Dotted) { dashLength = width; gapLength = width * 8f + 0.2f; } else { dashLength = 0.4f; gapLength = 0.35f; } List<(Vector3, Vector3)> dashes = ((style == LineStyle.Solid) ? BuildSolid(points) : BuildDashes(points, dashLength, gapLength, phaseOffset)); UpdateLineSegments(root, segments, dashes, color, width); if (style == LineStyle.Dotted) { UpdateDiamonds(root, diamonds, dashes, color, width); } else { HideSegments(diamonds); } } private bool LineEndsAtElevator(PathResult result, bool targetIsElevator) { //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_0053: 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_0060: 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) //IL_009e: 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) if ((Object)(object)mineshaftBottomTarget == (Object)null) { return false; } if (!targetIsElevator) { return false; } if (!TryGetPosition(mineshaftBottomTarget, out var pos)) { return false; } if (result.IsDoorBlocked) { return false; } List points = result.Points; if (points == null || points.Count == 0) { return false; } Vector3 val = points[points.Count - 1]; float num = val.x - pos.x; float num2 = val.z - pos.z; float num3 = Mathf.Sqrt(num * num + num2 * num2); if (result.IsDeadEnd) { Plugin.Logger.LogDebug((object)($"LeadMeOut: elevator check — line ends {num3:F1} away (XZ) from the shaft, " + $"dY {Mathf.Abs(val.y - pos.y):F1}, radius {10f} => " + ((num3 <= 10f) ? "ELEVATOR" : "not the elevator"))); } return num3 <= 10f; } private GameObject UpdateDeadEndMarker(GameObject marker, GameObject root, bool show, List points, Color color, float brightness, bool elevatorEndpoint, float lateralOffset = 0f) { //IL_002e: 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_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_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_0047: 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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: 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_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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007b: 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_0084: 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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008b: 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_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_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Expected O, but got Unknown //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Expected O, but got Unknown //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020d: 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_019c: Unknown result type (might be due to invalid IL or missing references) //IL_019d: 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_028b: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_029b: 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_0222: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: 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_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_023f: 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_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_0380: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_0329: Unknown result type (might be due to invalid IL or missing references) //IL_0334: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_033e: Unknown result type (might be due to invalid IL or missing references) //IL_03a8: Unknown result type (might be due to invalid IL or missing references) //IL_03b2: Unknown result type (might be due to invalid IL or missing references) //IL_03bc: Unknown result type (might be due to invalid IL or missing references) //IL_03d7: Unknown result type (might be due to invalid IL or missing references) //IL_035a: Unknown result type (might be due to invalid IL or missing references) //IL_0361: Unknown result type (might be due to invalid IL or missing references) //IL_0366: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_0373: Unknown result type (might be due to invalid IL or missing references) if (!show || points == null || points.Count < 2) { if ((Object)(object)marker != (Object)null) { marker.SetActive(false); } return marker; } Vector3 val = points[points.Count - 1]; Vector3 val2 = points[points.Count - 2]; Vector3 val3 = val - val2; Vector3 normalized = ((Vector3)(ref val3)).normalized; if (Mathf.Abs(lateralOffset) > 0.001f) { val3 = Vector3.Cross(Vector3.up, normalized); Vector3 normalized2 = ((Vector3)(ref val3)).normalized; val -= normalized2 * lateralOffset; val2 -= normalized2 * lateralOffset; } bool flag = elevatorEndpoint; Vector3 doorPos = Vector3.zero; Vector3 doorNormal = Vector3.up; bool flag2 = false; if (!flag) { flag2 = FindLockedDoorNear(val, out doorPos, out doorNormal); } if (flag) { brightness = 1f; } if ((Object)(object)marker == (Object)null) { marker = new GameObject("DeadEndMarker"); marker.transform.SetParent(root.transform, false); marker.AddComponent(); MeshRenderer obj = marker.AddComponent(); ((Renderer)obj).material = new Material(Shader.Find("HDRP/Unlit")); ((Renderer)obj).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)obj).receiveShadows = false; } marker.SetActive(true); MeshFilter component = marker.GetComponent(); string text = (flag2 ? "lock" : (flag ? "elevator" : "arrow")); if (((Object)marker).name != "DeadEndMarker_" + text) { component.mesh = (flag2 ? BuildLockMesh() : (flag ? BuildElevatorMesh() : Build4WayArrowMesh())); ((Object)marker).name = "DeadEndMarker_" + text; } Vector3 val6; if (flag2) { Vector3 val4 = -normalized; val4.y = 0f; if (((Vector3)(ref val4)).sqrMagnitude < 0.001f) { val4 = -doorNormal; } ((Vector3)(ref val4)).Normalize(); Vector3 val5 = doorNormal; val6 = doorPos + val4 * 0.6f; } else { Vector3 val5 = Vector3.up; val6 = val + Vector3.up * 0.05f; int num = -1; RaycastHit val7 = default(RaycastHit); if (Physics.Raycast(val2, normalized, ref val7, 1f, num, (QueryTriggerInteraction)1) && Mathf.Abs(((RaycastHit)(ref val7)).normal.y) < 0.5f) { val5 = ((RaycastHit)(ref val7)).normal; val6 = val - Vector3.Dot(val - ((RaycastHit)(ref val7)).point, val5) * val5 + val5 * 0.05f + Vector3.up * 0.25f; } else if (Physics.Raycast(val + Vector3.up * 0.5f, Vector3.down, ref val7, 2f, num, (QueryTriggerInteraction)1)) { val5 = ((RaycastHit)(ref val7)).normal; val6 = new Vector3(val.x, ((RaycastHit)(ref val7)).point.y, val.z) + val5 * 0.05f; } } marker.transform.position = val6 + Vector3.up * 0.7f; PlayerControllerB localPlayer = GetLocalPlayer(); if ((Object)(object)localPlayer != (Object)null) { Vector3 val8 = ((Component)localPlayer).transform.position - marker.transform.position; val8.y = 0f; if (((Vector3)(ref val8)).sqrMagnitude > 0.001f) { Quaternion rotation = Quaternion.LookRotation(Vector3.up, ((Vector3)(ref val8)).normalized); marker.transform.rotation = rotation; } } marker.transform.localScale = Vector3.one * 0.8f; MeshRenderer component2 = marker.GetComponent(); if ((Object)(object)component2 != (Object)null) { Color color2 = default(Color); ((Color)(ref color2))..ctor(color.r * brightness, color.g * brightness, color.b * brightness, 1f); ((Renderer)component2).material.color = color2; } return marker; } private bool FindLockedDoorNear(Vector3 point, out Vector3 doorPos, out Vector3 doorNormal) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: 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_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_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: 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_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) doorPos = point; doorNormal = Vector3.up; DoorLock val = null; float num = 4f; foreach (var item2 in GetDoorCache()) { DoorLock item = item2.door; if (!((Object)(object)item == (Object)null) && item.isLocked) { float num2 = Vector3.Distance(point, ((Component)item).transform.position); if (num2 < num) { num = num2; val = item; } } } if ((Object)(object)val == (Object)null) { return false; } doorPos = ((Component)val).transform.position; doorNormal = ((Component)val).transform.forward; doorNormal.y = 0f; if (((Vector3)(ref doorNormal)).sqrMagnitude < 0.001f) { doorNormal = Vector3.forward; } ((Vector3)(ref doorNormal)).Normalize(); return true; } private void RenderShapes(GameObject root, List shapes, List points, Color color, LineStyle style, float width, Vector3 targetPos) { //IL_00c6: 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_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) float num = ((style != LineStyle.Heart && style != LineStyle.Pawprint) ? (width * 20f + 0.6f) : (width * 12f + 0.4f)); if (num < 0.05f) { num = 0.05f; } List<(Vector3, Vector3)> shapePlacements = GetShapePlacements(points, num); for (int i = 0; i < shapes.Count; i++) { if (i < shapePlacements.Count) { shapes[i].SetActive(true); MeshFilter component = shapes[i].GetComponent(); if ((Object)(object)component != (Object)null) { component.mesh = (Mesh)(style switch { LineStyle.Pawprint => BuildPawprintMesh(), LineStyle.Diamond => BuildDiamondMesh(), LineStyle.Triangle => BuildTriangleMesh(), LineStyle.Arrow => BuildArrowMesh(), _ => BuildHeartMesh(), }); } ApplyShapeTransform(shapes[i], shapePlacements[i].Item1, shapePlacements[i].Item2, width); ((Renderer)shapes[i].GetComponent()).material.color = color; } else { shapes[i].SetActive(false); } } for (int j = shapes.Count; j < shapePlacements.Count; j++) { GameObject val = CreateShapeMesh(root, style, color, width); ApplyShapeTransform(val, shapePlacements[j].Item1, shapePlacements[j].Item2, width); shapes.Add(val); } } private List<(Vector3 pos, Vector3 dir)> GetShapePlacements(List points, float spacing) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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_003d: 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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) List<(Vector3, Vector3)> list = new List<(Vector3, Vector3)>(); int num = 200; float num2 = spacing * 0.5f; for (int i = 1; i < points.Count; i++) { if (list.Count >= num) { break; } Vector3 val = points[i - 1]; Vector3 val2 = points[i]; float num3 = Vector3.Distance(val, val2); if (num3 < 0.001f) { continue; } Vector3 val3 = val2 - val; Vector3 normalized = ((Vector3)(ref val3)).normalized; float num4 = 0f; while (num4 < num3 && list.Count < num) { float num5 = spacing - num2; if (num4 + num5 <= num3) { num4 += num5; list.Add((val + normalized * num4, normalized)); num2 = 0f; } else { num2 += num3 - num4; num4 = num3; } } } return list; } private void ApplyShapeTransform(GameObject shape, Vector3 pos, Vector3 dir, float width) { //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_000d: 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_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) shape.transform.position = pos; if (dir != Vector3.zero) { shape.transform.rotation = Quaternion.LookRotation(dir, Vector3.up); } float num = width * 6f; shape.transform.localScale = new Vector3(num, num, num); } private GameObject CreateShapeMesh(GameObject root, LineStyle style, Color color, float width) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: 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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Expected O, but got Unknown GameObject val = new GameObject("Shape"); val.transform.SetParent(root.transform); MeshFilter val2 = val.AddComponent(); MeshRenderer obj = val.AddComponent(); val2.mesh = (Mesh)(style switch { LineStyle.Pawprint => BuildPawprintMesh(), LineStyle.Diamond => BuildDiamondMesh(), LineStyle.Triangle => BuildTriangleMesh(), LineStyle.Arrow => BuildArrowMesh(), _ => BuildHeartMesh(), }); Material val3 = new Material(Shader.Find("HDRP/Unlit")); val3.color = color; ((Renderer)obj).material = val3; ((Renderer)obj).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)obj).receiveShadows = false; return val; } private Mesh BuildArrowMesh() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //IL_001d: 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_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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_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_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_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) Mesh val = new Mesh(); Vector3[] vertices = (Vector3[])(object)new Vector3[7] { new Vector3(-0.15f, 0f, -0.5f), new Vector3(0.15f, 0f, -0.5f), new Vector3(0.15f, 0f, 0.1f), new Vector3(-0.15f, 0f, 0.1f), new Vector3(-0.35f, 0f, 0.1f), new Vector3(0.35f, 0f, 0.1f), new Vector3(0f, 0f, 0.5f) }; val.vertices = vertices; val.triangles = new int[18] { 0, 1, 2, 0, 2, 3, 4, 5, 6, 2, 1, 0, 3, 2, 0, 6, 5, 4 }; val.RecalculateNormals(); return val; } private Mesh BuildTriangleMesh() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_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_0054: 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) Mesh val = new Mesh(); val.vertices = (Vector3[])(object)new Vector3[3] { new Vector3(0f, 0f, 0.5f), new Vector3(-0.5f, 0f, -0.4f), new Vector3(0.5f, 0f, -0.4f) }; val.triangles = new int[6] { 0, 1, 2, 2, 1, 0 }; val.RecalculateNormals(); return val; } private Mesh BuildHeartMesh() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) Mesh val = new Mesh(); int num = 20; List list = new List(); List list2 = new List(); list.Add(new Vector3(0f, 0f, 0f)); for (int i = 0; i <= num; i++) { float num2 = (float)i / (float)num * (float)Math.PI * 2f; float num3 = 0.4f * Mathf.Pow(Mathf.Sin(num2), 3f); float num4 = 0.4f * (0.8125f * Mathf.Cos(num2) - 0.3125f * Mathf.Cos(2f * num2) - 0.125f * Mathf.Cos(3f * num2) - 0.0625f * Mathf.Cos(4f * num2)); list.Add(new Vector3(num3, 0f, num4)); } int num5 = num; for (int j = 1; j <= num5; j++) { list2.Add(0); list2.Add(j); list2.Add((j >= num5) ? 1 : (j + 1)); } int count = list2.Count; for (int k = 0; k < count; k += 3) { list2.Add(list2[k + 2]); list2.Add(list2[k + 1]); list2.Add(list2[k]); } val.vertices = list.ToArray(); val.triangles = list2.ToArray(); val.RecalculateNormals(); return val; } private Mesh BuildDiamondMesh() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_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_0054: 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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) Mesh val = new Mesh(); val.vertices = (Vector3[])(object)new Vector3[4] { new Vector3(0f, 0f, 0.6f), new Vector3(0.28f, 0f, 0f), new Vector3(0f, 0f, -0.6f), new Vector3(-0.28f, 0f, 0f) }; val.triangles = new int[12] { 0, 1, 2, 0, 2, 3, 2, 1, 0, 3, 2, 0 }; val.RecalculateNormals(); return val; } private Mesh BuildPawprintMesh() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Expected O, but got Unknown Mesh val = new Mesh(); List verts = new List(); List tris = new List(); int circleSegments = 12; AddEllipse(0f, -0.15f, 0.22f, 0.22f); AddEllipse(-0.1f, 0.22f, 0.09f, 0.11f); AddEllipse(0.1f, 0.22f, 0.09f, 0.11f); AddEllipse(-0.24f, 0.08f, 0.08f, 0.1f); AddEllipse(0.24f, 0.08f, 0.08f, 0.1f); val.vertices = verts.ToArray(); val.triangles = tris.ToArray(); val.RecalculateNormals(); return val; void AddEllipse(float cx, float cz, float rx, float rz) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) int count = verts.Count; verts.Add(new Vector3(cx, 0f, cz)); int count2 = verts.Count; for (int i = 0; i < circleSegments; i++) { float num = (float)i / (float)circleSegments * (float)Math.PI * 2f; verts.Add(new Vector3(cx + rx * Mathf.Cos(num), 0f, cz + rz * Mathf.Sin(num))); } for (int j = 0; j < circleSegments; j++) { int item = count2 + j; int item2 = count2 + (j + 1) % circleSegments; tris.Add(count); tris.Add(item); tris.Add(item2); tris.Add(count); tris.Add(item2); tris.Add(item); } } } private Mesh Build4WayArrowMesh() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: 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_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0277: 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) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_030b: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_036e: Unknown result type (might be due to invalid IL or missing references) //IL_03eb: Unknown result type (might be due to invalid IL or missing references) //IL_03ec: Unknown result type (might be due to invalid IL or missing references) //IL_03ee: Unknown result type (might be due to invalid IL or missing references) //IL_03f3: Unknown result type (might be due to invalid IL or missing references) //IL_03fa: Unknown result type (might be due to invalid IL or missing references) //IL_03fb: Unknown result type (might be due to invalid IL or missing references) //IL_03fd: Unknown result type (might be due to invalid IL or missing references) //IL_0402: Unknown result type (might be due to invalid IL or missing references) //IL_0409: Unknown result type (might be due to invalid IL or missing references) //IL_040a: Unknown result type (might be due to invalid IL or missing references) //IL_040c: Unknown result type (might be due to invalid IL or missing references) //IL_0411: Unknown result type (might be due to invalid IL or missing references) //IL_0418: Unknown result type (might be due to invalid IL or missing references) //IL_0419: Unknown result type (might be due to invalid IL or missing references) //IL_041b: Unknown result type (might be due to invalid IL or missing references) //IL_0420: Unknown result type (might be due to invalid IL or missing references) //IL_0519: Unknown result type (might be due to invalid IL or missing references) //IL_051b: Unknown result type (might be due to invalid IL or missing references) //IL_0522: Unknown result type (might be due to invalid IL or missing references) //IL_0524: Unknown result type (might be due to invalid IL or missing references) //IL_052b: Unknown result type (might be due to invalid IL or missing references) //IL_052d: Unknown result type (might be due to invalid IL or missing references) //IL_0534: Unknown result type (might be due to invalid IL or missing references) //IL_0536: Unknown result type (might be due to invalid IL or missing references) Mesh val = new Mesh(); List verts = new List(); List tris = new List(); Poly((Vector3[])(object)new Vector3[4] { new Vector3(-0.072f, 0f, 0.181f), new Vector3(0.07f, 0f, 0.181f), new Vector3(0.07f, 0f, 0.287f), new Vector3(-0.072f, 0f, 0.287f) }); Poly((Vector3[])(object)new Vector3[3] { new Vector3(-0.167f, 0f, 0.287f), new Vector3(0.166f, 0f, 0.287f), new Vector3(-0.001f, 0f, 0.477f) }); Poly((Vector3[])(object)new Vector3[4] { new Vector3(-0.072f, 0f, -0.181f), new Vector3(0.07f, 0f, -0.181f), new Vector3(0.07f, 0f, -0.287f), new Vector3(-0.072f, 0f, -0.287f) }); Poly((Vector3[])(object)new Vector3[3] { new Vector3(0.166f, 0f, -0.287f), new Vector3(-0.167f, 0f, -0.287f), new Vector3(-0.001f, 0f, -0.477f) }); Poly((Vector3[])(object)new Vector3[4] { new Vector3(-0.181f, 0f, -0.071f), new Vector3(-0.181f, 0f, 0.071f), new Vector3(-0.288f, 0f, 0.071f), new Vector3(-0.288f, 0f, -0.071f) }); Poly((Vector3[])(object)new Vector3[3] { new Vector3(-0.288f, 0f, 0.166f), new Vector3(-0.288f, 0f, -0.166f), new Vector3(-0.478f, 0f, 0f) }); Poly((Vector3[])(object)new Vector3[4] { new Vector3(0.18f, 0f, -0.071f), new Vector3(0.18f, 0f, 0.071f), new Vector3(0.286f, 0f, 0.071f), new Vector3(0.286f, 0f, -0.071f) }); Poly((Vector3[])(object)new Vector3[3] { new Vector3(0.286f, 0f, -0.166f), new Vector3(0.286f, 0f, 0.166f), new Vector3(0.476f, 0f, 0f) }); Ring(0f, 0.02f, 0.145f, 0.115f, 24); Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(0.095f, 0f, -0.075f); Vector3 val3 = default(Vector3); ((Vector3)(ref val3))..ctor(0.175f, 0f, -0.155f); Vector3 val4 = default(Vector3); ((Vector3)(ref val4))..ctor(0.022f, 0f, 0.022f); Poly((Vector3[])(object)new Vector3[4] { val2 - val4, val2 + val4, val3 + val4, val3 - val4 }); int num = 20; float num2 = 0.085f; float num3 = 0.048f; float num4 = 0.014f; Vector3 val5 = default(Vector3); Vector3 val6 = default(Vector3); Vector3 val7 = default(Vector3); Vector3 val8 = default(Vector3); for (int i = 0; i < num; i++) { float num5 = (float)Math.PI * 2f * ((float)i / (float)num); float num6 = (float)Math.PI * 2f * ((float)(i + 1) / (float)num); ((Vector3)(ref val5))..ctor(Mathf.Cos(num5) * num2, 0f, 0.02f + Mathf.Sin(num5) * num3); ((Vector3)(ref val6))..ctor(Mathf.Cos(num6) * num2, 0f, 0.02f + Mathf.Sin(num6) * num3); ((Vector3)(ref val7))..ctor(Mathf.Cos(num5) * (num2 - num4), 0f, 0.02f + Mathf.Sin(num5) * (num3 - num4)); ((Vector3)(ref val8))..ctor(Mathf.Cos(num6) * (num2 - num4), 0f, 0.02f + Mathf.Sin(num6) * (num3 - num4)); Poly((Vector3[])(object)new Vector3[4] { val7, val5, val6, val8 }); } Disc(0f, 0.02f, 0.026f, 12); val.vertices = verts.ToArray(); val.triangles = tris.ToArray(); val.RecalculateNormals(); return val; void Disc(float cx, float cz, float r, int seg) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) int count = verts.Count; verts.Add(new Vector3(cx, 0f, cz)); int count2 = verts.Count; for (int j = 0; j < seg; j++) { float num7 = (float)Math.PI * 2f * ((float)j / (float)seg); verts.Add(new Vector3(cx + Mathf.Cos(num7) * r, 0f, cz + Mathf.Sin(num7) * r)); } for (int k = 0; k < seg; k++) { int item = count2 + k; int item2 = count2 + (k + 1) % seg; tris.Add(count); tris.Add(item); tris.Add(item2); tris.Add(count); tris.Add(item2); tris.Add(item); } } void Poly(Vector3[] p) { //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_0020: Unknown result type (might be due to invalid IL or missing references) int count = verts.Count; foreach (Vector3 item in p) { verts.Add(item); } for (int k = 1; k < p.Length - 1; k++) { tris.Add(count); tris.Add(count + k); tris.Add(count + k + 1); tris.Add(count); tris.Add(count + k + 1); tris.Add(count + k); } } void Ring(float cx, float cz, float rOuter, float rInner, int seg, float startAngle = 0f, float sweep = (float)Math.PI * 2f) { //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: 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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) Vector3 val9 = default(Vector3); Vector3 val10 = default(Vector3); Vector3 val11 = default(Vector3); Vector3 val12 = default(Vector3); for (int j = 0; j < seg; j++) { float num7 = startAngle + sweep * ((float)j / (float)seg); float num8 = startAngle + sweep * ((float)(j + 1) / (float)seg); ((Vector3)(ref val9))..ctor(cx + Mathf.Cos(num7) * rOuter, 0f, cz + Mathf.Sin(num7) * rOuter); ((Vector3)(ref val10))..ctor(cx + Mathf.Cos(num8) * rOuter, 0f, cz + Mathf.Sin(num8) * rOuter); ((Vector3)(ref val11))..ctor(cx + Mathf.Cos(num7) * rInner, 0f, cz + Mathf.Sin(num7) * rInner); ((Vector3)(ref val12))..ctor(cx + Mathf.Cos(num8) * rInner, 0f, cz + Mathf.Sin(num8) * rInner); Poly((Vector3[])(object)new Vector3[4] { val11, val9, val10, val12 }); } } } private Mesh BuildLockMesh() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //IL_003a: 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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) Mesh val = new Mesh(); List verts = new List(); List tris = new List(); float num = 0.3f; float num2 = 0.22f; float num3 = -0.23f; Quad(new Vector3(0f - num, 0f, num3), new Vector3(0f - num, 0f, num2), new Vector3(num, 0f, num2), new Vector3(num, 0f, num3)); float num4 = 0.22f; float num5 = 0.12f; float num6 = 0.22f; int num7 = 10; Vector3 b = default(Vector3); Vector3 c = default(Vector3); Vector3 d = default(Vector3); for (int i = 0; i < num7; i++) { float num8 = (float)Math.PI * ((float)i / (float)num7); float num9 = (float)Math.PI * ((float)(i + 1) / (float)num7); ((Vector3)(ref b))..ctor((0f - Mathf.Cos(num8)) * num4, 0f, num6 + Mathf.Sin(num8) * num4); ((Vector3)(ref c))..ctor((0f - Mathf.Cos(num9)) * num4, 0f, num6 + Mathf.Sin(num9) * num4); Vector3 a = new Vector3((0f - Mathf.Cos(num8)) * num5, 0f, num6 + Mathf.Sin(num8) * num5); ((Vector3)(ref d))..ctor((0f - Mathf.Cos(num9)) * num5, 0f, num6 + Mathf.Sin(num9) * num5); Quad(a, b, c, d); } val.vertices = verts.ToArray(); val.triangles = tris.ToArray(); val.RecalculateNormals(); return val; void Quad(Vector3 item, Vector3 item2, Vector3 item3, Vector3 item4) { //IL_0014: 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_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) int count = verts.Count; verts.Add(item); verts.Add(item2); verts.Add(item3); verts.Add(item4); tris.Add(count); tris.Add(count + 1); tris.Add(count + 2); tris.Add(count); tris.Add(count + 2); tris.Add(count + 3); tris.Add(count); tris.Add(count + 2); tris.Add(count + 1); tris.Add(count); tris.Add(count + 3); tris.Add(count + 2); } } private Mesh BuildElevatorMesh() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: 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_0117: 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_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) Mesh val = new Mesh(); List verts = new List(); List tris = new List(); Disc(-0.29f, 0.33f, 0.105f, 16); Rect(-0.42f, 0.19f, -0.16f, -0.1f); Rect(-0.42f, -0.1f, -0.32f, -0.42f); Rect(-0.26f, -0.1f, -0.16f, -0.42f); Poly((Vector3[])(object)new Vector3[3] { new Vector3(0.06f, 0f, 0.1f), new Vector3(0.46f, 0f, 0.1f), new Vector3(0.26f, 0f, 0.45f) }); Poly((Vector3[])(object)new Vector3[3] { new Vector3(0.06f, 0f, -0.02f), new Vector3(0.46f, 0f, -0.02f), new Vector3(0.26f, 0f, -0.37f) }); val.vertices = verts.ToArray(); val.triangles = tris.ToArray(); val.RecalculateNormals(); return val; void Disc(float cx, float cz, float r, int seg) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) int count = verts.Count; verts.Add(new Vector3(cx, 0f, cz)); int count2 = verts.Count; for (int i = 0; i < seg; i++) { float num = (float)Math.PI * 2f * ((float)i / (float)seg); verts.Add(new Vector3(cx + Mathf.Cos(num) * r, 0f, cz + Mathf.Sin(num) * r)); } for (int j = 0; j < seg; j++) { int item = count2 + j; int item2 = count2 + (j + 1) % seg; tris.Add(count); tris.Add(item); tris.Add(item2); tris.Add(count); tris.Add(item2); tris.Add(item); } } void Poly(Vector3[] p) { //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_0020: Unknown result type (might be due to invalid IL or missing references) int count = verts.Count; foreach (Vector3 item in p) { verts.Add(item); } for (int j = 1; j < p.Length - 1; j++) { tris.Add(count); tris.Add(count + j); tris.Add(count + j + 1); tris.Add(count); tris.Add(count + j + 1); tris.Add(count + j); } } void Rect(float x0, float z0, float x1, float z1) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_0048: 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) Poly((Vector3[])(object)new Vector3[4] { new Vector3(x0, 0f, z0), new Vector3(x1, 0f, z0), new Vector3(x1, 0f, z1), new Vector3(x0, 0f, z1) }); } } private List<(Vector3, Vector3)> BuildSolid(List points) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) List<(Vector3, Vector3)> list = new List<(Vector3, Vector3)>(); for (int i = 1; i < points.Count; i++) { list.Add((points[i - 1], points[i])); } return list; } private List<(Vector3, Vector3)> BuildDashes(List points, float dashLength, float gapLength, float phaseOffset) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003e: 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0061: 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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) List<(Vector3, Vector3)> list = new List<(Vector3, Vector3)>(); float num = phaseOffset % (dashLength + gapLength); bool flag = num < dashLength; float num2 = (flag ? (dashLength - num) : (gapLength - (num - dashLength))); for (int i = 1; i < points.Count; i++) { Vector3 val = points[i - 1]; Vector3 val2 = points[i]; float num3 = Vector3.Distance(val, val2); float num4 = 0f; while (num4 < num3) { float num5 = Mathf.Min(num2, num3 - num4); Vector3 item = Vector3.Lerp(val, val2, num4 / num3); Vector3 item2 = Vector3.Lerp(val, val2, (num4 + num5) / num3); if (flag) { list.Add((item, item2)); } num4 += num5; num2 -= num5; if (num2 <= 0.001f) { flag = !flag; num2 = (flag ? dashLength : gapLength); } } } return list; } private void UpdateLineSegments(GameObject root, List segments, List<(Vector3 start, Vector3 end)> dashes, Color color, float width) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0069: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < segments.Count; i++) { if (i < dashes.Count) { ((Component)segments[i]).gameObject.SetActive(true); segments[i].startWidth = width; segments[i].endWidth = width; segments[i].startColor = color; segments[i].endColor = color; ((Renderer)segments[i]).material.color = color; segments[i].SetPosition(0, dashes[i].start); segments[i].SetPosition(1, dashes[i].end); } else { ((Component)segments[i]).gameObject.SetActive(false); } } for (int j = segments.Count; j < dashes.Count; j++) { GameObject val = new GameObject($"Seg_{j}"); val.transform.SetParent(root.transform); LineRenderer val2 = val.AddComponent(); SetupLineRenderer(val2, color, width); val2.SetPosition(0, dashes[j].start); val2.SetPosition(1, dashes[j].end); segments.Add(val2); } } private void UpdateDiamonds(GameObject root, List diamonds, List<(Vector3 start, Vector3 end)> dashes, Color color, float width) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008a: 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_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_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_0100: 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_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) float[] array = new float[3] { 22.5f, 45f, 158.5f }; int count = dashes.Count; int num = count * array.Length; for (int i = 0; i < diamonds.Count; i++) { if (i < num) { int index = i % count; float num2 = array[i / count]; Vector3 val = (dashes[index].start + dashes[index].end) * 0.5f; Vector3 val2 = Quaternion.Euler(0f, num2, 0f) * (dashes[index].end - dashes[index].start); ((Component)diamonds[i]).gameObject.SetActive(true); diamonds[i].startWidth = width; diamonds[i].endWidth = width; diamonds[i].startColor = color; diamonds[i].endColor = color; ((Renderer)diamonds[i]).material.color = color; diamonds[i].SetPosition(0, val - val2 * 0.5f); diamonds[i].SetPosition(1, val + val2 * 0.5f); } else { ((Component)diamonds[i]).gameObject.SetActive(false); } } for (int j = diamonds.Count; j < num; j++) { int index2 = j % count; float num3 = array[j / count]; GameObject val3 = new GameObject($"Diamond_{j}"); val3.transform.SetParent(root.transform); LineRenderer val4 = val3.AddComponent(); SetupLineRenderer(val4, color, width); Vector3 val5 = (dashes[index2].start + dashes[index2].end) * 0.5f; Vector3 val6 = Quaternion.Euler(0f, num3, 0f) * (dashes[index2].end - dashes[index2].start); val4.SetPosition(0, val5 - val6 * 0.5f); val4.SetPosition(1, val5 + val6 * 0.5f); diamonds.Add(val4); } } private void SetupLineRenderer(LineRenderer lr, Color color, float width) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Expected O, but got Unknown //IL_001b: 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_0029: Unknown result type (might be due to invalid IL or missing references) ((Renderer)lr).material = new Material(Shader.Find("HDRP/Unlit")); ((Renderer)lr).material.color = color; lr.startColor = color; lr.endColor = color; lr.startWidth = width; lr.endWidth = width; lr.useWorldSpace = true; lr.positionCount = 2; ((Renderer)lr).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)lr).receiveShadows = false; } private List ApplyLateralOffset(List points, float offset) { //IL_0020: 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_002e: 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_0037: 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_003c: 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_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: 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_0068: 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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: 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_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: 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_008f: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_009b: 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) List list = new List(points.Count); Vector3 val7 = default(Vector3); for (int i = 0; i < points.Count; i++) { Vector3 val; Vector3 val2; if (i <= 0) { val = Vector3.zero; } else { val2 = points[i] - points[i - 1]; val = ((Vector3)(ref val2)).normalized; } Vector3 val3 = val; Vector3 val4; if (i >= points.Count - 1) { val4 = Vector3.zero; } else { val2 = points[i + 1] - points[i]; val4 = ((Vector3)(ref val2)).normalized; } Vector3 val5 = val4; val2 = val3 + val5; Vector3 val6 = ((Vector3)(ref val2)).normalized; if (val6 == Vector3.zero) { val6 = ((val3 != Vector3.zero) ? val3 : val5); } ((Vector3)(ref val7))..ctor(0f - val6.z, 0f, val6.x); list.Add(points[i] + val7 * offset); } return list; } private void HideSegments(List segments) { foreach (LineRenderer segment in segments) { if ((Object)(object)segment != (Object)null) { ((Component)segment).gameObject.SetActive(false); } } } private void HideShapes(List shapes) { foreach (GameObject shape in shapes) { if ((Object)(object)shape != (Object)null) { shape.SetActive(false); } } } private Vector3 ElevatorNudge(Vector3 from, Vector3 target, float amount) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: 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_0038: 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_0022: Unknown result type (might be due to invalid IL or missing references) Vector3 val = target - from; val.y = 0f; if (((Vector3)(ref val)).sqrMagnitude < 0.001f) { return target; } ((Vector3)(ref val)).Normalize(); Vector3 val2 = Vector3.Cross(val, Vector3.up); return target + val2 * amount; } private Vector3[] CenterCorners(Vector3[] corners) { //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_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: 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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: 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_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) if (corners.Length < 3) { return corners; } Vector3[] array = (Vector3[])(object)new Vector3[corners.Length]; array[0] = corners[0]; array[corners.Length - 1] = corners[^1]; for (int i = 1; i < corners.Length - 1; i++) { Vector3 forward = corners[i + 1] - corners[i - 1]; forward.y = 0f; if (((Vector3)(ref forward)).sqrMagnitude < 0.001f) { array[i] = corners[i]; continue; } ((Vector3)(ref forward)).Normalize(); if (Mathf.Abs(corners[i + 1].y - corners[i - 1].y) > 0.75f) { array[i] = corners[i]; } else { array[i] = CenterInCorridor(corners[i], forward); } } return array; } private Vector3 CenterInCorridor(Vector3 point, Vector3 forward) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //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_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0046: 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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.Cross(Vector3.up, forward); Vector3 normalized = ((Vector3)(ref val)).normalized; float num = 3f; float num2 = 3f; NavMeshHit val2 = default(NavMeshHit); if (NavMesh.Raycast(point, point + normalized * 3f, ref val2, -1)) { num = ((NavMeshHit)(ref val2)).distance; } NavMeshHit val3 = default(NavMeshHit); if (NavMesh.Raycast(point, point - normalized * 3f, ref val3, -1)) { num2 = ((NavMeshHit)(ref val3)).distance; } float num3 = (num - num2) * 0.5f; NavMeshHit val4 = default(NavMeshHit); if (NavMesh.SamplePosition(point + normalized * num3, ref val4, 0.5f, -1)) { return ((NavMeshHit)(ref val4)).position; } return point; } private Vector3 ClosestPointOnSegment(Vector3 p, Vector3 a, Vector3 b) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: 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_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0031: 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_0034: 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_0018: Unknown result type (might be due to invalid IL or missing references) Vector3 val = b - a; float magnitude = ((Vector3)(ref val)).magnitude; if (magnitude < 0.001f) { return a; } float num = Mathf.Clamp01(Vector3.Dot(p - a, val) / (magnitude * magnitude)); return a + val * num; } private List SnapThroughDoorways(List corners, out HashSet pinned) { //IL_003c: 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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_004d: 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_005f: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0084: 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_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_039c: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Unknown result type (might be due to invalid IL or missing references) //IL_03cc: Unknown result type (might be due to invalid IL or missing references) //IL_03d3: Unknown result type (might be due to invalid IL or missing references) //IL_03dd: Unknown result type (might be due to invalid IL or missing references) //IL_03e2: Unknown result type (might be due to invalid IL or missing references) //IL_03e7: Unknown result type (might be due to invalid IL or missing references) //IL_03eb: Unknown result type (might be due to invalid IL or missing references) //IL_03f2: Unknown result type (might be due to invalid IL or missing references) //IL_03fc: Unknown result type (might be due to invalid IL or missing references) //IL_0401: Unknown result type (might be due to invalid IL or missing references) //IL_0406: Unknown result type (might be due to invalid IL or missing references) //IL_0409: Unknown result type (might be due to invalid IL or missing references) //IL_041a: Unknown result type (might be due to invalid IL or missing references) //IL_0429: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_046b: Unknown result type (might be due to invalid IL or missing references) //IL_0483: Unknown result type (might be due to invalid IL or missing references) //IL_049b: Unknown result type (might be due to invalid IL or missing references) //IL_0449: Unknown result type (might be due to invalid IL or missing references) //IL_044e: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_0288: 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_0292: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) pinned = new HashSet(); if (corners == null || corners.Count < 2) { return corners; } List list = new List(); float num = float.MaxValue; float num2 = float.MinValue; float num3 = float.MaxValue; float num4 = float.MinValue; for (int i = 0; i < corners.Count; i++) { Vector3 val = corners[i]; if (val.x < num) { num = val.x; } if (val.x > num2) { num2 = val.x; } if (val.z < num3) { num3 = val.z; } if (val.z > num4) { num4 = val.z; } } num -= 3f; num2 += 3f; num3 -= 3f; num4 += 3f; foreach (var item in GetDoorCache()) { if ((Object)(object)item.door == (Object)null) { continue; } Vector3 position = ((Component)item.door).transform.position; if (position.x < num || position.x > num2 || position.z < num3 || position.z > num4) { continue; } int num5 = -1; float num6 = float.MaxValue; Vector3 val2 = Vector3.zero; for (int j = 0; j < corners.Count - 1; j++) { Vector3 val3 = ClosestPointOnSegment(position, corners[j], corners[j + 1]); float num7 = Vector3.Distance(val3, position); if (num7 < num6) { num6 = num7; num5 = j; val2 = val3; } } if (num5 < 0 || num6 > 3f) { continue; } Vector3 val4 = corners[num5 + 1] - corners[num5]; val4.y = 0f; if (((Vector3)(ref val4)).sqrMagnitude < 0.0001f) { continue; } ((Vector3)(ref val4)).Normalize(); Vector3 val5 = CenterInCorridor(val2, val4); if (Vector3.Distance(val5, val2) > 1.5f) { continue; } bool flag = false; foreach (DoorwayCrossing item2 in list) { if (Vector3.Distance(item2.centre, val5) < 3.6f) { flag = true; break; } } if (!flag) { Vector3 val6 = corners[num5 + 1] - corners[num5]; float magnitude = ((Vector3)(ref val6)).magnitude; float t = ((magnitude > 0.001f) ? Mathf.Clamp01(Vector3.Dot(val2 - corners[num5], val6) / (magnitude * magnitude)) : 0f); list.Add(new DoorwayCrossing { seg = num5, t = t, centre = val5, dir = val4 }); } } if (list.Count == 0) { return corners; } list.Sort((DoorwayCrossing x, DoorwayCrossing y) => (x.seg == y.seg) ? x.t.CompareTo(y.t) : x.seg.CompareTo(y.seg)); List list2 = new List(); NavMeshHit val7 = default(NavMeshHit); for (int num8 = 0; num8 < corners.Count; num8++) { bool flag2 = false; if (num8 != 0 && num8 != corners.Count - 1) { foreach (DoorwayCrossing item3 in list) { if (Vector3.Distance(corners[num8], item3.centre) < 1.8f) { flag2 = true; break; } } } if (!flag2) { list2.Add(corners[num8]); } foreach (DoorwayCrossing item4 in list) { if (item4.seg == num8) { Vector3 p = item4.centre - item4.dir * 1f; Vector3 p2 = item4.centre + item4.dir * 1f; if (SnapToMeshKeepingXZ(p, out var snapped) && SnapToMeshKeepingXZ(item4.centre, out var snapped2) && SnapToMeshKeepingXZ(p2, out var snapped3) && (list2.Count <= 0 || !NavMesh.Raycast(list2[list2.Count - 1], snapped, ref val7, -1))) { pinned.Add(list2.Count); list2.Add(snapped); pinned.Add(list2.Count); list2.Add(snapped2); pinned.Add(list2.Count); list2.Add(snapped3); } } } } return list2; } private bool SnapToMeshKeepingXZ(Vector3 p, out Vector3 snapped) { //IL_0000: 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_0037: 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_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: 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) NavMeshHit val = default(NavMeshHit); if (NavMesh.SamplePosition(p, ref val, 1f, -1)) { snapped = new Vector3(p.x, ((NavMeshHit)(ref val)).position.y, p.z); return true; } snapped = p; return false; } private bool FindNearestReachablePoint(Vector3 from, Vector3 target, out Vector3 result) { //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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) result = Vector3.zero; float[] array = new float[5] { 2f, 4f, 6f, 9f, 13f }; NavMeshHit val = default(NavMeshHit); foreach (float num in array) { for (int j = 0; j < 16; j++) { float num2 = (float)j * 22.5f * ((float)Math.PI / 180f); if (NavMesh.SamplePosition(target + new Vector3(Mathf.Cos(num2) * num, 0f, Mathf.Sin(num2) * num), ref val, 2f, -1) && !(Mathf.Abs(((NavMeshHit)(ref val)).position.y - target.y) > 4f) && IsPathComplete(from, ((NavMeshHit)(ref val)).position)) { result = ((NavMeshHit)(ref val)).position; return true; } } } return false; } private List SmoothPath(Vector3[] corners) { return SmoothPath(new List(corners), null); } private List SmoothPath(List corners, HashSet pinned) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0055: 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_005f: 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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_009d: 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_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: 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_0102: 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) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0158: 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) //IL_015f: Unknown result type (might be due to invalid IL or missing references) List list = new List(); if (corners.Count < 2) { list.AddRange(corners); return list; } list.Add(corners[0]); for (int i = 1; i < corners.Count - 1; i++) { if (pinned != null && pinned.Contains(i)) { list.Add(corners[i]); continue; } Vector3 val = corners[i - 1] - corners[i]; Vector3 val2 = corners[i + 1] - corners[i]; float magnitude = ((Vector3)(ref val)).magnitude; float magnitude2 = ((Vector3)(ref val2)).magnitude; if (magnitude < 0.001f || magnitude2 < 0.001f) { list.Add(corners[i]); continue; } float num = Mathf.Min(0.9f, magnitude * 0.5f); float num2 = Mathf.Min(0.9f, magnitude2 * 0.5f); Vector3 val3 = corners[i] + val / magnitude * num; Vector3 val4 = corners[i] + val2 / magnitude2 * num2; for (int j = 0; j <= bezierSteps; j++) { float num3 = (float)j / (float)bezierSteps; float num4 = 1f - num3; list.Add(num4 * num4 * val3 + 2f * num4 * num3 * corners[i] + num3 * num3 * val4); } } list.Add(corners[corners.Count - 1]); return list; } private void ClearLineRoots() { if ((Object)(object)mainEntranceRoot != (Object)null) { Object.Destroy((Object)(object)mainEntranceRoot); mainEntranceRoot = null; } mainEntranceSegments.Clear(); mainEntranceDiamonds.Clear(); mainEntranceShapes.Clear(); mainEntranceMarker = null; foreach (GameObject fireExitRoot in fireExitRoots) { if ((Object)(object)fireExitRoot != (Object)null) { Object.Destroy((Object)(object)fireExitRoot); } } fireExitRoots.Clear(); fireExitSegmentSets.Clear(); fireExitDiamondSets.Clear(); fireExitShapeSets.Clear(); fireExitMarkers.Clear(); } private void ClearAll() { ClearLineRoots(); ClearCompassOverlay(); mainEntranceTarget = null; mineshaftBottomTarget = null; mineshaftTopTarget = null; fireExitTargets.Clear(); doorSimCache.Clear(); doorSimMisses.Clear(); doorSimTimer = 999f; } } public class LeadMeOutInputActions : LcInputActions { [InputAction("/l", Name = "Toggle Exit Markers")] public InputAction ToggleKey { get; set; } } public class SolidColorGraphic : Graphic { public override Material defaultMaterial => Canvas.GetDefaultCanvasMaterial(); protected override void OnPopulateMesh(VertexHelper vh) { //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_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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_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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_008f: 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_009a: 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_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) vh.Clear(); Rect rect = ((Graphic)this).rectTransform.rect; UIVertex val = new UIVertex { uv0 = Vector4.op_Implicit(Vector2.zero), color = Color32.op_Implicit(((Graphic)this).color), position = new Vector3(((Rect)(ref rect)).xMin, ((Rect)(ref rect)).yMin) }; vh.AddVert(val); val.position = new Vector3(((Rect)(ref rect)).xMin, ((Rect)(ref rect)).yMax); vh.AddVert(val); val.position = new Vector3(((Rect)(ref rect)).xMax, ((Rect)(ref rect)).yMax); vh.AddVert(val); val.position = new Vector3(((Rect)(ref rect)).xMax, ((Rect)(ref rect)).yMin); vh.AddVert(val); vh.AddTriangle(0, 1, 2); vh.AddTriangle(2, 3, 0); } } public class LeadMeOutRunner : MonoBehaviour { private void Awake() { Plugin.Logger.LogInfo((object)"LeadMeOut: Runner Awake."); } private void Start() { Plugin.Logger.LogInfo((object)"LeadMeOut: Runner Start."); } private void Update() { if (Plugin.InputActions != null && Plugin.InputActions.ToggleKey.WasPressedThisFrame()) { Plugin.Logger.LogInfo((object)"LeadMeOut: Toggle via InputUtils."); Plugin.ExitFinderInstance?.Toggle(); } else if (Keyboard.current != null && ((ButtonControl)Keyboard.current.lKey).wasPressedThisFrame) { Plugin.Logger.LogInfo((object)"LeadMeOut: Toggle via raw keyboard."); Plugin.ExitFinderInstance?.Toggle(); } Plugin.ExitFinderInstance?.Tick(Time.deltaTime); } } public static class LethalConfigHelper { public static void Register() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: 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_0047: Expected O, but got Unknown //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Expected O, but got Unknown //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Expected O, but got Unknown //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Expected O, but got Unknown //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Expected O, but got Unknown //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Expected O, but got Unknown //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Expected O, but got Unknown //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Expected O, but got Unknown //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Expected O, but got Unknown //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Expected O, but got Unknown //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Expected O, but got Unknown //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Expected O, but got Unknown //IL_012e: 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) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Expected O, but got Unknown //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Expected O, but got Unknown //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Expected O, but got Unknown //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Expected O, but got Unknown //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Expected O, but got Unknown //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Expected O, but got Unknown //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Expected O, but got Unknown //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Expected O, but got Unknown //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Expected O, but got Unknown LethalConfigManager.AddConfigItem((BaseConfigItem)(object)new EnumDropDownConfigItem(Plugin.NavMode, new EnumDropDownOptions { Name = "Navigation Mode", RequiresRestart = false })); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)new EnumDropDownConfigItem(Plugin.ShowLines, new EnumDropDownOptions { Name = "Show Lines", RequiresRestart = false })); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)new EnumDropDownConfigItem(Plugin.RenderDistance, new EnumDropDownOptions { Name = "Render Distance", RequiresRestart = false })); LethalConfigManager.AddConfigItem((BaseConfigItem)new BoolCheckBoxConfigItem(Plugin.AutoEnableOnEntry, new BoolCheckBoxOptions { Name = "Auto-Enable On Entry", RequiresRestart = false })); ConfigEntry brightness = Plugin.Brightness; IntSliderOptions val = new IntSliderOptions { Name = "Brightness (%)" }; ((BaseRangeOptions)val).Min = 20; ((BaseRangeOptions)val).Max = 100; ((BaseOptions)val).RequiresRestart = false; LethalConfigManager.AddConfigItem((BaseConfigItem)new IntSliderConfigItem(brightness, val)); ConfigEntry pathUpdateRate = Plugin.PathUpdateRate; IntSliderOptions val2 = new IntSliderOptions { Name = "Path Update Rate (Hz)" }; ((BaseRangeOptions)val2).Min = 1; ((BaseRangeOptions)val2).Max = 10; ((BaseOptions)val2).RequiresRestart = false; LethalConfigManager.AddConfigItem((BaseConfigItem)new IntSliderConfigItem(pathUpdateRate, val2)); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)new EnumDropDownConfigItem(Plugin.MainEntranceLineStyle, new EnumDropDownOptions { Name = "Main Entrance - Line Style", RequiresRestart = false })); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)new EnumDropDownConfigItem(Plugin.MainEntranceLineWidth, new EnumDropDownOptions { Name = "Main Entrance - Line Width", RequiresRestart = false })); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)new EnumDropDownConfigItem(Plugin.MainEntranceColorPreset, new EnumDropDownOptions { Name = "Main Entrance - Color", RequiresRestart = false })); LethalConfigManager.AddConfigItem((BaseConfigItem)new TextInputFieldConfigItem(Plugin.MainEntranceCustomColor, new TextInputFieldOptions { Name = "Main Entrance - Custom Hex", RequiresRestart = false })); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)new EnumDropDownConfigItem(Plugin.FireExitLineStyle, new EnumDropDownOptions { Name = "Fire Exit - Line Style", RequiresRestart = false })); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)new EnumDropDownConfigItem(Plugin.FireExitLineWidth, new EnumDropDownOptions { Name = "Fire Exit - Line Width", RequiresRestart = false })); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)new EnumDropDownConfigItem(Plugin.FireExitColorPreset, new EnumDropDownOptions { Name = "Fire Exit - Color", RequiresRestart = false })); LethalConfigManager.AddConfigItem((BaseConfigItem)new TextInputFieldConfigItem(Plugin.FireExitCustomColor, new TextInputFieldOptions { Name = "Fire Exit - Custom Hex", RequiresRestart = false })); } } [HarmonyPatch(typeof(NetworkManager))] internal static class NetworkPrefabPatch { private static readonly string MOD_GUID = "LeadMeOut"; [HarmonyPostfix] [HarmonyPatch("SetSingleton")] private static void RegisterPrefab() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Expected O, but got Unknown //IL_0017: 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) GameObject val = new GameObject(MOD_GUID + " Prefab"); ((Object)val).hideFlags = (HideFlags)(((Object)val).hideFlags | 0x3D); Object.DontDestroyOnLoad((Object)(object)val); NetworkObject obj = val.AddComponent(); typeof(NetworkObject).GetField("GlobalObjectIdHash", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(obj, GetHash(MOD_GUID)); NetworkManager.Singleton.PrefabHandler.AddNetworkPrefab(val); static uint GetHash(string value) { return value?.Aggregate(17u, (uint current, char c) => (current * 31) ^ c) ?? 0; } } } public enum LineStyle { Solid, Dashed, Dotted, Arrow, Triangle, Diamond, Heart, Pawprint } public enum LineColorPreset { Green, Red, Cyan, Magenta, Yellow, White, Blue, Orange, Purple, Black, Custom } public enum LineWidthPreset { Hairline, Thin, Standard, Heavy, Thiccc } public enum ShowLinesPreset { ShowBoth, MainEntranceOnly, FireExitsOnly } public enum NavigationMode { LinearMode, CompassMode } public enum RenderDistancePreset { Short, Medium, Long, Full } [BepInPlugin("LeadMeOut", "LeadMeOut", "2.0.1")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { internal static ManualLogSource Logger; internal static LeadMeOutInputActions InputActions; internal static ExitFinder ExitFinderInstance; internal static ConfigEntry MainEntranceLineStyle; internal static ConfigEntry MainEntranceLineWidth; internal static ConfigEntry MainEntranceColorPreset; internal static ConfigEntry MainEntranceCustomColor; internal static ConfigEntry FireExitLineStyle; internal static ConfigEntry FireExitLineWidth; internal static ConfigEntry FireExitColorPreset; internal static ConfigEntry FireExitCustomColor; internal static ConfigEntry NavMode; internal static ConfigEntry ShowLines; internal static ConfigEntry RenderDistance; internal static ConfigEntry AutoEnableOnEntry; internal static ConfigEntry Brightness; internal static ConfigEntry PathUpdateRate; private static GameObject runnerObject; private void Awake() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Expected O, but got Unknown //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Expected O, but got Unknown Logger = ((BaseUnityPlugin)this).Logger; Logger.LogInfo((object)"Plugin LeadMeOut is loaded!"); new Harmony("LeadMeOut").PatchAll(); MainEntranceLineStyle = ((BaseUnityPlugin)this).Config.Bind("Main Entrance", "LineStyle", LineStyle.Solid, "Line style for the main entrance path.\nStyle options do not affect Compass mode."); MainEntranceLineWidth = ((BaseUnityPlugin)this).Config.Bind("Main Entrance", "LineWidth", LineWidthPreset.Standard, "Line width for the main entrance path."); MainEntranceColorPreset = ((BaseUnityPlugin)this).Config.Bind("Main Entrance", "Color", LineColorPreset.Green, "Color of the main entrance line."); MainEntranceCustomColor = ((BaseUnityPlugin)this).Config.Bind("Main Entrance", "CustomHex", "#00FF00", "Custom hex color for main entrance. Only used when Color is set to Custom."); FireExitLineStyle = ((BaseUnityPlugin)this).Config.Bind("Fire Exit", "LineStyle", LineStyle.Solid, "Line style for the fire exit path.\nStyle options do not affect Compass mode."); FireExitLineWidth = ((BaseUnityPlugin)this).Config.Bind("Fire Exit", "LineWidth", LineWidthPreset.Standard, "Line width for the fire exit path."); FireExitColorPreset = ((BaseUnityPlugin)this).Config.Bind("Fire Exit", "Color", LineColorPreset.Red, "Color of the fire exit line."); FireExitCustomColor = ((BaseUnityPlugin)this).Config.Bind("Fire Exit", "CustomHex", "#FF0000", "Custom hex color for fire exit. Only used when Color is set to Custom."); NavMode = ((BaseUnityPlugin)this).Config.Bind("Behavior", "NavigationMode", NavigationMode.LinearMode, "LinearMode shows navigational path lines on the floor.\nCompassMode overlays directional markers on the HUD compass.\nLine Style options only affect Linear Mode and do not affect Compass Mode."); ShowLines = ((BaseUnityPlugin)this).Config.Bind("Behavior", "ShowLines", ShowLinesPreset.ShowBoth, "Choose which exit lines to show."); RenderDistance = ((BaseUnityPlugin)this).Config.Bind("Behavior", "RenderDistance", RenderDistancePreset.Medium, "How far ahead the path line renders. Short=15, Medium=30, Long=50, Full=unlimited."); AutoEnableOnEntry = ((BaseUnityPlugin)this).Config.Bind("Behavior", "AutoEnableOnEntry", false, "Automatically show lines when entering a facility. Hotkey toggles navigation off/on."); Brightness = ((BaseUnityPlugin)this).Config.Bind("Behavior", "Brightness", 80, new ConfigDescription("Brightness of exit markers (lines and compass pips). Enter a value between 20 and 100.", (AcceptableValueBase)(object)new AcceptableValueRange(20, 100), Array.Empty())); PathUpdateRate = ((BaseUnityPlugin)this).Config.Bind("Behavior", "PathUpdateRate", 5, new ConfigDescription("How many times per second the navigation path recalculates. Lower values are lighter on performance (fewer updates per second) at the cost of the line reacting more slowly as you move. Default 5. Raise it toward 10 for a snappier line, or lower it if you get micro-stutters while walking.", (AcceptableValueBase)(object)new AcceptableValueRange(1, 10), Array.Empty())); if (Chainloader.PluginInfos.ContainsKey("ainavt.lc.lethalconfig")) { LethalConfigHelper.Register(); Logger.LogInfo((object)"LeadMeOut: LethalConfig registered."); } InputActions = new LeadMeOutInputActions(); ((LcInputActions)InputActions).Enable(); ExitFinderInstance = new ExitFinder(); SceneManager.sceneLoaded += OnSceneLoaded; Logger.LogInfo((object)"LeadMeOut: Waiting for scene to create runner."); } private static void OnSceneLoaded(Scene scene, LoadSceneMode mode) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown Logger.LogInfo((object)("LeadMeOut: Scene loaded - " + ((Scene)(ref scene)).name)); if ((Object)(object)runnerObject == (Object)null) { runnerObject = new GameObject("LeadMeOut_Runner"); runnerObject.AddComponent(); Object.DontDestroyOnLoad((Object)(object)runnerObject); Logger.LogInfo((object)"LeadMeOut: Runner created."); } } internal static Color ResolveColor(LineColorPreset preset, string customHex, Color fallback) { //IL_0046: 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_0070: 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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: 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_00df: 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_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) switch (preset) { case LineColorPreset.Green: return new Color(0f, 1f, 0f); case LineColorPreset.Red: return new Color(1f, 0f, 0f); case LineColorPreset.Cyan: return new Color(0f, 0.94f, 1f); case LineColorPreset.Magenta: return new Color(1f, 0.01f, 0.74f); case LineColorPreset.Yellow: return new Color(0.88f, 1f, 0f); case LineColorPreset.White: return Color.white; case LineColorPreset.Blue: return new Color(0f, 0.37f, 1f); case LineColorPreset.Orange: return new Color(1f, 0.5f, 0f); case LineColorPreset.Purple: return new Color(0.51f, 0f, 1f); case LineColorPreset.Black: return Color.black; case LineColorPreset.Custom: { Color result = default(Color); if (ColorUtility.TryParseHtmlString(customHex, ref result)) { return result; } return fallback; } default: return fallback; } } internal static float ResolveRenderDistance(RenderDistancePreset preset) { return preset switch { RenderDistancePreset.Short => 15f, RenderDistancePreset.Medium => 30f, RenderDistancePreset.Long => 50f, RenderDistancePreset.Full => float.MaxValue, _ => 30f, }; } internal static float ResolveWidth(LineWidthPreset preset) { return preset switch { LineWidthPreset.Hairline => 0.0125f, LineWidthPreset.Thin => 0.025f, LineWidthPreset.Standard => 0.05f, LineWidthPreset.Heavy => 0.1f, LineWidthPreset.Thiccc => 0.2f, _ => 0.05f, }; } internal static float ResolvePipWidth(LineWidthPreset preset) { return preset switch { LineWidthPreset.Hairline => 0.5f, LineWidthPreset.Thin => 1f, LineWidthPreset.Standard => 2f, LineWidthPreset.Heavy => 5f, LineWidthPreset.Thiccc => 8f, _ => 2f, }; } internal static Color ApplyBrightness(Color c) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002b: 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_0039: Unknown result type (might be due to invalid IL or missing references) float num = (float)Mathf.Clamp(Brightness.Value, 20, 100) / 100f; return new Color(c.r * num, c.g * num, c.b * num, c.a); } } public static class MyPluginInfo { public const string PLUGIN_GUID = "LeadMeOut"; public const string PLUGIN_NAME = "LeadMeOut"; public const string PLUGIN_VERSION = "2.0.1"; }