Decompiled source of DebugUnlocker MapEditor v5.7.0
debugunlocker.dll
Decompiled 2 days ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; using BepInEx; using HarmonyLib; using UnityEngine; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")] [assembly: AssemblyCompany("debugunlocker")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("My first plugin")] [assembly: AssemblyTitle("debugunlocker")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace debugunlocker; [DefaultExecutionOrder(10000)] public class MapEditor : MonoBehaviour { private enum ToolMode { Move, Rotate, Resize } [Serializable] private class SavedMapItem { public string name; public string sourceName; public bool isPrimitive; public int primType; public float px; public float py; public float pz; public float rx; public float ry; public float rz; public float rw; public float sx; public float sy; public float sz; public float cr = 1f; public float cg = 1f; public float cb = 1f; public bool hasCollision; public bool webbable = true; } public static bool IsOpen = false; public static int WalkableLayer = 0; public static string WalkableTag = "Untagged"; public static List<GameObject> SpawnedObjects = new List<GameObject>(); private ToolMode _mode = ToolMode.Move; private bool _showColliders = false; private bool _is2DMode = false; private float _orthoSize = 6f; private string _mapName = "MyCustomMap"; private bool _showMapList = false; private Vector2 _mapListScroll; private List<string> _savedMapFiles = new List<string>(); private Vector3 _activeCheckpointPos; private Quaternion _activeCheckpointRot; private bool _hasActiveCheckpoint = false; private PropertyInfo _kbProp; private PropertyInfo _f12Prop; private PropertyInfo _wProp; private PropertyInfo _aProp; private PropertyInfo _sProp; private PropertyInfo _dProp; private PropertyInfo _qProp; private PropertyInfo _eProp; private PropertyInfo _shiftProp; private PropertyInfo _upProp; private PropertyInfo _downProp; private PropertyInfo _leftProp; private PropertyInfo _rightProp; private PropertyInfo _keyPressedProp; private PropertyInfo _keyIsPressedProp; private PropertyInfo _mouseProp; private PropertyInfo _leftBtnProp; private PropertyInfo _rightBtnProp; private PropertyInfo _posProp; private MethodInfo _readVec2; private float _camSpeed = 12f; private string _status = "WASD+QE Fly | Right-Drag or Arrows Look | Drag X/Y/Z Gizmos"; private Vector3 _camPos; private Vector3 _lastMousePos; private Vector3 _dragStartVal; private Vector3 _dragStartDir; private Quaternion _dragStartRot; private float _yaw; private float _pitch; private Camera _editorCam; private Material _wireMat; private List<Collider> _cachedColliders = new List<Collider>(); private bool _hasDefaultSpawn = false; private Vector3 _defaultSpawnPos; private Quaternion _defaultSpawnRot; private GameObject _playerStartObj; private GameObject _moveGizmoRoot; private GameObject _rotGizmoRoot; private List<Transform> _gizmoAxes = new List<Transform>(); private List<Transform> _gizmoTips = new List<Transform>(); private List<Transform> _rotRings = new List<Transform>(); private int _dragAxis = -1; private Plane _dragPlane; private Vector3 _dragHitOffset; private static Shader _cachedLitShader; private Camera ActiveCam => ((Object)(object)_editorCam != (Object)null) ? _editorCam : Camera.main; public static void RegisterSpawned(GameObject go) { if ((Object)(object)go != (Object)null && !SpawnedObjects.Contains(go)) { SpawnedObjects.Add(go); } } private void Awake() { //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Expected O, but got Unknown Assembly assembly = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault((Assembly a) => a.GetName().Name == "Unity.InputSystem"); if (assembly != null) { Type type = assembly.GetType("UnityEngine.InputSystem.Keyboard"); Type type2 = assembly.GetType("UnityEngine.InputSystem.Mouse"); Type type3 = assembly.GetType("UnityEngine.InputSystem.Controls.KeyControl"); Type type4 = assembly.GetType("UnityEngine.InputSystem.Controls.ButtonControl"); _kbProp = type?.GetProperty("current", BindingFlags.Static | BindingFlags.Public); _f12Prop = type?.GetProperty("f12Key"); _wProp = type?.GetProperty("wKey"); _aProp = type?.GetProperty("aKey"); _sProp = type?.GetProperty("sKey"); _dProp = type?.GetProperty("dKey"); _qProp = type?.GetProperty("qKey"); _eProp = type?.GetProperty("eKey"); _shiftProp = type?.GetProperty("leftShiftKey"); _upProp = type?.GetProperty("upArrowKey"); _downProp = type?.GetProperty("downArrowKey"); _leftProp = type?.GetProperty("leftArrowKey"); _rightProp = type?.GetProperty("rightArrowKey"); _keyPressedProp = type3?.GetProperty("wasPressedThisFrame"); _keyIsPressedProp = type4?.GetProperty("isPressed"); _mouseProp = type2?.GetProperty("current", BindingFlags.Static | BindingFlags.Public); _leftBtnProp = type2?.GetProperty("leftButton"); _rightBtnProp = type2?.GetProperty("rightButton"); _posProp = type2?.GetProperty("position"); _readVec2 = assembly.GetType("UnityEngine.InputSystem.Controls.Vector2Control")?.GetMethod("ReadValue", Type.EmptyTypes); } Shader val = Shader.Find("Hidden/Internal-Colored") ?? Shader.Find("Sprites/Default"); if ((Object)(object)val != (Object)null) { _wireMat = new Material(val); } BuildGizmos(); } private void BuildGizmos() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0081: 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_00bf: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_011d: 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_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0140: 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_015e: 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_01ba: 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_01d8: 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_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Expected O, but got Unknown //IL_0286: 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_0215: 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_0356: Unknown result type (might be due to invalid IL or missing references) //IL_0358: 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_0364: 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_0378: Unknown result type (might be due to invalid IL or missing references) //IL_037a: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Unknown result type (might be due to invalid IL or missing references) //IL_039d: 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_03c3: Unknown result type (might be due to invalid IL or missing references) //IL_03f6: Unknown result type (might be due to invalid IL or missing references) _moveGizmoRoot = new GameObject("MapEditor_MoveGizmo"); _rotGizmoRoot = new GameObject("MapEditor_RotGizmo"); Object.DontDestroyOnLoad((Object)(object)_moveGizmoRoot); Object.DontDestroyOnLoad((Object)(object)_rotGizmoRoot); List<Color> list = new List<Color> { Color.red, Color.green, Color.blue }; List<Vector3> list2 = new List<Vector3> { Vector3.right, Vector3.up, Vector3.forward }; Vector3 val5 = default(Vector3); Vector3 val6 = default(Vector3); foreach (int item in Enumerable.Range(0, 3)) { GameObject val = new GameObject($"Axis_{item}"); val.transform.SetParent(_moveGizmoRoot.transform); GameObject val2 = GameObject.CreatePrimitive((PrimitiveType)2); val2.transform.SetParent(val.transform); val2.transform.localScale = new Vector3(0.14f, 0.9f, 0.14f); val2.transform.localPosition = list2[item] * 0.9f; val2.transform.localRotation = Quaternion.FromToRotation(Vector3.up, list2[item]); val2.GetComponent<Renderer>().material.color = list[item]; CapsuleCollider component = val2.GetComponent<CapsuleCollider>(); if ((Object)(object)component != (Object)null) { component.radius = 1.6f; } GameObject val3 = GameObject.CreatePrimitive((PrimitiveType)3); val3.transform.SetParent(val.transform); val3.transform.localScale = Vector3.one * 0.36f; val3.transform.localPosition = list2[item] * 1.85f; val3.GetComponent<Renderer>().material.color = list[item]; BoxCollider component2 = val3.GetComponent<BoxCollider>(); if ((Object)(object)component2 != (Object)null) { component2.size = Vector3.one * 1.8f; } _gizmoAxes.Add(val.transform); _gizmoTips.Add(val3.transform); GameObject val4 = new GameObject($"RotRing_{item}"); val4.transform.SetParent(_rotGizmoRoot.transform); val4.transform.localRotation = Quaternion.FromToRotation(Vector3.up, list2[item]); int num = 24; float num2 = 1.75f; foreach (int item2 in Enumerable.Range(0, num)) { float num3 = (float)item2 * 2f * MathF.PI / (float)num; float num4 = (float)(item2 + 1) * 2f * MathF.PI / (float)num; ((Vector3)(ref val5))..ctor(Mathf.Cos(num3) * num2, 0f, Mathf.Sin(num3) * num2); ((Vector3)(ref val6))..ctor(Mathf.Cos(num4) * num2, 0f, Mathf.Sin(num4) * num2); GameObject val7 = GameObject.CreatePrimitive((PrimitiveType)3); val7.transform.SetParent(val4.transform); val7.transform.localPosition = (val5 + val6) * 0.5f; val7.transform.localRotation = Quaternion.LookRotation(val6 - val5); val7.transform.localScale = new Vector3(0.14f, 0.14f, Vector3.Distance(val5, val6) + 0.06f); val7.GetComponent<Renderer>().material.color = list[item]; BoxCollider component3 = val7.GetComponent<BoxCollider>(); if ((Object)(object)component3 != (Object)null) { component3.size = new Vector3(2.4f, 2.4f, 1.3f); } } _rotRings.Add(val4.transform); } _moveGizmoRoot.SetActive(false); _rotGizmoRoot.SetActive(false); } private void Update() { object obj = _kbProp?.GetValue(null); if (obj != null) { object obj2 = _f12Prop?.GetValue(obj); if (obj2 != null && (bool)_keyPressedProp.GetValue(obj2)) { SetEditorOpen(!IsOpen); } if (!IsOpen) { CheckCheckpointsAndRespawn(obj); return; } Time.timeScale = 0f; Physics.simulationMode = (SimulationMode)2; Cursor.lockState = (CursorLockMode)0; Cursor.visible = true; HandleFreeCam(obj); HandleGizmoAndSelection(); UpdateGizmoTransform(); } } private void LateUpdate() { //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_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_0081: 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_009b: 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_00bd: 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_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) GameObject val = GameObject.Find("PlayerSpider"); if (!((Object)(object)val == (Object)null)) { Transform val2 = (((Object)(object)val.transform.parent != (Object)null && ((Object)val.transform.parent).name.Contains("Player")) ? val.transform.parent : val.transform); if ((Object)(object)val2.parent != (Object)null) { Vector3 lossyScale = val2.parent.lossyScale; val2.localScale = new Vector3((lossyScale.x != 0f) ? (1f / lossyScale.x) : 1f, (lossyScale.y != 0f) ? (1f / lossyScale.y) : 1f, (lossyScale.z != 0f) ? (1f / lossyScale.z) : 1f); } else if (val2.localScale != Vector3.one) { val2.localScale = Vector3.one; } } } private void SetEditorOpen(bool open) { //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Expected O, but got Unknown //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_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_036f: Unknown result type (might be due to invalid IL or missing references) //IL_0374: 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_0378: Unknown result type (might be due to invalid IL or missing references) //IL_0174: 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_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0189: 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) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_0247: 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_01b0: 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_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_03e3: Unknown result type (might be due to invalid IL or missing references) //IL_03e8: Unknown result type (might be due to invalid IL or missing references) //IL_03ea: Unknown result type (might be due to invalid IL or missing references) //IL_044d: Unknown result type (might be due to invalid IL or missing references) //IL_0452: Unknown result type (might be due to invalid IL or missing references) //IL_0454: Unknown result type (might be due to invalid IL or missing references) //IL_0463: 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_046a: 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_049d: Unknown result type (might be due to invalid IL or missing references) //IL_04a4: Unknown result type (might be due to invalid IL or missing references) //IL_04c0: Unknown result type (might be due to invalid IL or missing references) //IL_04c5: Unknown result type (might be due to invalid IL or missing references) //IL_04c7: Unknown result type (might be due to invalid IL or missing references) //IL_04f3: Unknown result type (might be due to invalid IL or missing references) //IL_04fa: Unknown result type (might be due to invalid IL or missing references) //IL_0515: Unknown result type (might be due to invalid IL or missing references) //IL_0527: Unknown result type (might be due to invalid IL or missing references) //IL_052c: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_056d: Unknown result type (might be due to invalid IL or missing references) IsOpen = open; _dragAxis = -1; GameObject val = GameObject.Find("PlayerSpider"); if (IsOpen) { if ((Object)(object)Plugin.Instance != (Object)null) { Plugin.Instance.ShowBrowserGui = false; } if ((Object)(object)_playerStartObj != (Object)null) { _playerStartObj.SetActive(true); } if (WalkableLayer == 0) { Collider val2 = ((IEnumerable<Collider>)Resources.FindObjectsOfTypeAll<Collider>()).FirstOrDefault((Func<Collider, bool>)((Collider c) => (Object)(object)c != (Object)null && !c.isTrigger && ((Component)c).gameObject.layer != 0 && ((Component)c).gameObject.layer != 2 && ((Component)c).gameObject.layer != 5 && !((Object)((Component)c).gameObject).name.Contains("Spider") && !((Object)((Component)c).gameObject).name.Contains("Player"))); if ((Object)(object)val2 != (Object)null) { WalkableLayer = ((Component)val2).gameObject.layer; WalkableTag = ((Component)val2).gameObject.tag; } } if ((Object)(object)val != (Object)null && !_hasDefaultSpawn) { _defaultSpawnPos = val.transform.position; _defaultSpawnRot = val.transform.rotation; _hasDefaultSpawn = true; } GameObject val3 = new GameObject("MapEditor_FreeCam"); _editorCam = val3.AddComponent<Camera>(); _editorCam.depth = 99f; Camera val4 = Camera.main ?? ((IEnumerable<Camera>)Camera.allCameras).FirstOrDefault((Func<Camera, bool>)((Camera c) => ((Behaviour)c).enabled && (Object)(object)c != (Object)(object)_editorCam)); if ((Object)(object)val4 != (Object)null) { _camPos = ((Component)val4).transform.position; Vector3 eulerAngles = ((Component)val4).transform.eulerAngles; _yaw = eulerAngles.y; _pitch = ((eulerAngles.x > 180f) ? (eulerAngles.x - 360f) : eulerAngles.x); _editorCam.fieldOfView = val4.fieldOfView; _editorCam.clearFlags = val4.clearFlags; _editorCam.backgroundColor = val4.backgroundColor; _editorCam.cullingMask = val4.cullingMask; } _editorCam.orthographic = _is2DMode; if (_is2DMode) { _editorCam.orthographicSize = _orthoSize; } ((Component)_editorCam).transform.SetPositionAndRotation(_camPos, Quaternion.Euler(_pitch, _yaw, 0f)); if (_showColliders) { _cachedColliders = Object.FindObjectsByType<Collider>((FindObjectsSortMode)0).ToList(); } Time.timeScale = 0f; Physics.simulationMode = (SimulationMode)2; AudioListener.pause = true; } else { _showMapList = false; _moveGizmoRoot.SetActive(false); _rotGizmoRoot.SetActive(false); if ((Object)(object)_playerStartObj != (Object)null) { _playerStartObj.SetActive(false); } if ((Object)(object)_editorCam != (Object)null) { Object.Destroy((Object)(object)((Component)_editorCam).gameObject); _editorCam = null; } MeshFilter[] array = Object.FindObjectsByType<MeshFilter>((FindObjectsSortMode)0); foreach (MeshFilter val5 in array) { GameObject gameObject = ((Component)val5).gameObject; if (!((Object)gameObject).name.StartsWith("Solid") && !((Object)gameObject).name.EndsWith("_Clone")) { continue; } Vector3 localScale = gameObject.transform.localScale; if (localScale == Vector3.one || (Object)(object)val5.sharedMesh == (Object)null) { continue; } Mesh val6 = Object.Instantiate<Mesh>(val5.sharedMesh); List<Vector3> list = val6.vertices.ToList(); foreach (int item in Enumerable.Range(0, list.Count)) { list[item] = Vector3.Scale(list[item], localScale); } val6.SetVertices(list); val6.RecalculateBounds(); val6.RecalculateNormals(); val5.sharedMesh = val6; BoxCollider component = gameObject.GetComponent<BoxCollider>(); if ((Object)(object)component != (Object)null) { component.size = Vector3.Scale(component.size, localScale); component.center = Vector3.Scale(component.center, localScale); } SphereCollider component2 = gameObject.GetComponent<SphereCollider>(); if ((Object)(object)component2 != (Object)null) { component2.radius *= Mathf.Max(localScale.x, Mathf.Max(localScale.y, localScale.z)); component2.center = Vector3.Scale(component2.center, localScale); } CapsuleCollider component3 = gameObject.GetComponent<CapsuleCollider>(); if ((Object)(object)component3 != (Object)null) { component3.radius *= Mathf.Max(localScale.x, localScale.z); component3.height *= localScale.y; component3.center = Vector3.Scale(component3.center, localScale); } MeshCollider component4 = gameObject.GetComponent<MeshCollider>(); if ((Object)(object)component4 != (Object)null) { component4.sharedMesh = null; component4.sharedMesh = val6; } gameObject.transform.localScale = Vector3.one; } Time.timeScale = 1f; Physics.SyncTransforms(); Physics.simulationMode = (SimulationMode)0; AudioListener.pause = false; if ((Object)(object)val != (Object)null && (_hasActiveCheckpoint || (Object)(object)_playerStartObj != (Object)null)) { RespawnAtCheckpoint(val); } } Plugin.Instance?.SetPauseState(IsOpen); } private Vector3 GetMouseScreenPos(object mouse) { //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_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) if (mouse != null && _posProp != null && _readVec2 != null) { Vector2 val = (Vector2)_readVec2.Invoke(_posProp.GetValue(mouse), null); return new Vector3(val.x, val.y, 0f); } return Input.mousePosition; } private void Toggle2DMode() { //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: 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_00ee: Unknown result type (might be due to invalid IL or missing references) _is2DMode = !_is2DMode; Camera activeCam = ActiveCam; if ((Object)(object)activeCam == (Object)null) { return; } activeCam.orthographic = _is2DMode; if (_is2DMode) { activeCam.orthographicSize = _orthoSize; _yaw = Mathf.Round(_yaw / 90f) * 90f; _pitch = 0f; object obj2; if (!((Object)(object)Plugin.SelectedObject != (Object)null)) { GameObject obj = GameObject.Find("PlayerSpider"); obj2 = ((obj != null) ? obj.transform : null); } else { obj2 = Plugin.SelectedObject.transform; } Transform val = (Transform)obj2; if ((Object)(object)val != (Object)null) { Quaternion val2 = Quaternion.Euler(0f, _yaw, 0f); _camPos = val.position - val2 * Vector3.forward * 12f; } _status = "2D Mode ON: WASD Pan | Q/E Zoom | Spawns lock to 2D plane!"; } else { _status = "3D Mode ON: WASD+QE Fly | Right-Drag Look"; } } private void HandleFreeCam(object kb) { //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_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_0227: Unknown result type (might be due to invalid IL or missing references) //IL_022c: 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_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_0248: 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_0255: 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_0278: 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_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_00d6: 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_0373: Unknown result type (might be due to invalid IL or missing references) //IL_0375: Unknown result type (might be due to invalid IL or missing references) //IL_037a: 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_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_0110: Unknown result type (might be due to invalid IL or missing references) //IL_038f: Unknown result type (might be due to invalid IL or missing references) //IL_0391: Unknown result type (might be due to invalid IL or missing references) //IL_0393: Unknown result type (might be due to invalid IL or missing references) //IL_0398: Unknown result type (might be due to invalid IL or missing references) //IL_039d: 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) //IL_03b7: Unknown result type (might be due to invalid IL or missing references) //IL_03b9: Unknown result type (might be due to invalid IL or missing references) //IL_03bb: Unknown result type (might be due to invalid IL or missing references) //IL_03c0: Unknown result type (might be due to invalid IL or missing references) //IL_03c5: Unknown result type (might be due to invalid IL or missing references) //IL_03ca: Unknown result type (might be due to invalid IL or missing references) //IL_03df: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03e3: Unknown result type (might be due to invalid IL or missing references) //IL_03e8: Unknown result type (might be due to invalid IL or missing references) //IL_03ed: 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_0137: 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_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: 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_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0407: 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_040b: Unknown result type (might be due to invalid IL or missing references) //IL_0410: Unknown result type (might be due to invalid IL or missing references) //IL_0415: 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_042f: Unknown result type (might be due to invalid IL or missing references) //IL_0431: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_043b: 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_01c5: 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_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: 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_0460: Unknown result type (might be due to invalid IL or missing references) //IL_0467: Unknown result type (might be due to invalid IL or missing references) //IL_0476: Unknown result type (might be due to invalid IL or missing references) //IL_047b: Unknown result type (might be due to invalid IL or missing references) //IL_0480: Unknown result type (might be due to invalid IL or missing references) //IL_048c: Unknown result type (might be due to invalid IL or missing references) //IL_0491: Unknown result type (might be due to invalid IL or missing references) //IL_0450: Unknown result type (might be due to invalid IL or missing references) //IL_0452: Unknown result type (might be due to invalid IL or missing references) //IL_0457: Unknown result type (might be due to invalid IL or missing references) //IL_045c: Unknown result type (might be due to invalid IL or missing references) Camera activeCam = ActiveCam; if ((Object)(object)activeCam == (Object)null) { return; } float unscaledDeltaTime = Time.unscaledDeltaTime; float num = (IsHeld(kb, _shiftProp) ? 2.5f : 1f); if (_is2DMode) { activeCam.orthographic = true; Quaternion val = Quaternion.Euler(0f, _yaw, 0f); Vector3 val2 = Vector3.zero; if (IsHeld(kb, _wProp) || IsHeld(kb, _upProp)) { val2 += Vector3.up; } if (IsHeld(kb, _sProp) || IsHeld(kb, _downProp)) { val2 += Vector3.down; } if (IsHeld(kb, _aProp) || IsHeld(kb, _leftProp)) { val2 += val * Vector3.left; } if (IsHeld(kb, _dProp) || IsHeld(kb, _rightProp)) { val2 += val * Vector3.right; } if (IsHeld(kb, _qProp)) { _orthoSize = Mathf.Clamp(_orthoSize + 8f * num * unscaledDeltaTime, 1.5f, 40f); } if (IsHeld(kb, _eProp)) { _orthoSize = Mathf.Clamp(_orthoSize - 8f * num * unscaledDeltaTime, 1.5f, 40f); } _camPos += ((Vector3)(ref val2)).normalized * (_camSpeed * num * unscaledDeltaTime); activeCam.orthographicSize = _orthoSize; ((Component)activeCam).transform.SetPositionAndRotation(_camPos, val); return; } activeCam.orthographic = false; object obj = _mouseProp?.GetValue(null); Vector3 mouseScreenPos = GetMouseScreenPos(obj); if (obj != null && IsBtnHeld(obj, _rightBtnProp)) { Vector3 val3 = mouseScreenPos - _lastMousePos; _yaw += val3.x * 0.25f; _pitch = Mathf.Clamp(_pitch - val3.y * 0.25f, -89f, 89f); } _lastMousePos = mouseScreenPos; if (IsHeld(kb, _leftProp)) { _yaw -= 90f * unscaledDeltaTime; } if (IsHeld(kb, _rightProp)) { _yaw += 90f * unscaledDeltaTime; } if (IsHeld(kb, _upProp)) { _pitch = Mathf.Clamp(_pitch - 70f * unscaledDeltaTime, -89f, 89f); } if (IsHeld(kb, _downProp)) { _pitch = Mathf.Clamp(_pitch + 70f * unscaledDeltaTime, -89f, 89f); } Quaternion val4 = Quaternion.Euler(_pitch, _yaw, 0f); Vector3 val5 = Vector3.zero; if (IsHeld(kb, _wProp)) { val5 += val4 * Vector3.forward; } if (IsHeld(kb, _sProp)) { val5 += val4 * Vector3.back; } if (IsHeld(kb, _aProp)) { val5 += val4 * Vector3.left; } if (IsHeld(kb, _dProp)) { val5 += val4 * Vector3.right; } if (IsHeld(kb, _eProp)) { val5 += Vector3.up; } if (IsHeld(kb, _qProp)) { val5 += Vector3.down; } _camPos += ((Vector3)(ref val5)).normalized * (_camSpeed * num * unscaledDeltaTime); ((Component)activeCam).transform.SetPositionAndRotation(_camPos, val4); } private void HandleGizmoAndSelection() { //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_009c: 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_00ab: 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_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_031d: 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_0116: 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_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0136: 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_0140: 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_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0165: 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_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0345: 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_01be: 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_01d5: 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_01e7: 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_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0220: 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_0229: Unknown result type (might be due to invalid IL or missing references) //IL_038c: 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_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_0284: 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_029c: 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_0624: Unknown result type (might be due to invalid IL or missing references) //IL_0667: Unknown result type (might be due to invalid IL or missing references) //IL_066c: Unknown result type (might be due to invalid IL or missing references) //IL_03f0: Unknown result type (might be due to invalid IL or missing references) //IL_0430: Unknown result type (might be due to invalid IL or missing references) //IL_0435: Unknown result type (might be due to invalid IL or missing references) //IL_0495: Unknown result type (might be due to invalid IL or missing references) //IL_049a: Unknown result type (might be due to invalid IL or missing references) //IL_04a4: Unknown result type (might be due to invalid IL or missing references) //IL_04b0: Unknown result type (might be due to invalid IL or missing references) //IL_04b5: Unknown result type (might be due to invalid IL or missing references) //IL_04ba: Unknown result type (might be due to invalid IL or missing references) //IL_04c5: Unknown result type (might be due to invalid IL or missing references) //IL_04d4: Unknown result type (might be due to invalid IL or missing references) //IL_04e0: Unknown result type (might be due to invalid IL or missing references) //IL_04e5: Unknown result type (might be due to invalid IL or missing references) //IL_04ea: Unknown result type (might be due to invalid IL or missing references) //IL_04ee: Unknown result type (might be due to invalid IL or missing references) //IL_04f3: Unknown result type (might be due to invalid IL or missing references) //IL_051d: Unknown result type (might be due to invalid IL or missing references) //IL_050f: Unknown result type (might be due to invalid IL or missing references) //IL_088b: Unknown result type (might be due to invalid IL or missing references) //IL_0890: Unknown result type (might be due to invalid IL or missing references) //IL_0894: 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_0546: Unknown result type (might be due to invalid IL or missing references) //IL_054b: 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_0550: Unknown result type (might be due to invalid IL or missing references) //IL_0552: Unknown result type (might be due to invalid IL or missing references) //IL_055a: Unknown result type (might be due to invalid IL or missing references) //IL_055f: Unknown result type (might be due to invalid IL or missing references) //IL_0561: Unknown result type (might be due to invalid IL or missing references) //IL_0566: Unknown result type (might be due to invalid IL or missing references) //IL_056b: Unknown result type (might be due to invalid IL or missing references) //IL_056f: Unknown result type (might be due to invalid IL or missing references) //IL_0574: Unknown result type (might be due to invalid IL or missing references) //IL_059d: Unknown result type (might be due to invalid IL or missing references) //IL_05a6: Unknown result type (might be due to invalid IL or missing references) //IL_05ab: Unknown result type (might be due to invalid IL or missing references) //IL_05b0: Unknown result type (might be due to invalid IL or missing references) //IL_05bb: Unknown result type (might be due to invalid IL or missing references) //IL_05ca: Unknown result type (might be due to invalid IL or missing references) //IL_05d6: Unknown result type (might be due to invalid IL or missing references) //IL_05db: Unknown result type (might be due to invalid IL or missing references) //IL_05e0: Unknown result type (might be due to invalid IL or missing references) //IL_0590: Unknown result type (might be due to invalid IL or missing references) //IL_0595: Unknown result type (might be due to invalid IL or missing references) //IL_059a: Unknown result type (might be due to invalid IL or missing references) Camera activeCam = ActiveCam; object obj = _mouseProp?.GetValue(null); object obj2 = ((obj == null) ? null : _leftBtnProp?.GetValue(obj)); if (obj2 == null || (Object)(object)activeCam == (Object)null) { return; } bool flag = (bool)_keyPressedProp.GetValue(obj2); bool flag2 = (bool)_keyIsPressedProp.GetValue(obj2); Vector3 mouseScreenPos = GetMouseScreenPos(obj); if (!flag2) { _dragAxis = -1; return; } GameObject selectedObject = Plugin.SelectedObject; Ray val = activeCam.ScreenPointToRay(mouseScreenPos); List<Vector3> list = new List<Vector3> { Vector3.right, Vector3.up, Vector3.forward }; Vector3 val3; if (_dragAxis >= 0 && (Object)(object)selectedObject != (Object)null) { if (_mode == ToolMode.Rotate) { Vector3 val2 = list[_dragAxis]; float num = default(float); if (((Plane)(ref _dragPlane)).Raycast(val, ref num)) { val3 = ((Ray)(ref val)).GetPoint(num) - selectedObject.transform.position; Vector3 normalized = ((Vector3)(ref val3)).normalized; float num2 = Vector3.SignedAngle(_dragStartDir, normalized, val2); selectedObject.transform.rotation = Quaternion.AngleAxis(num2, val2) * _dragStartRot; } } else { Vector3 val4 = ((_mode == ToolMode.Resize) ? selectedObject.transform.TransformDirection(list[_dragAxis]) : list[_dragAxis]); float num3 = default(float); if (((Plane)(ref _dragPlane)).Raycast(val, ref num3)) { Vector3 val5 = ((Ray)(ref val)).GetPoint(num3) - _dragHitOffset; float num4 = Vector3.Dot(val5 - selectedObject.transform.position, val4); if (_mode == ToolMode.Move) { selectedObject.transform.position = _dragStartVal + val4 * num4; } else { GameObject val6 = GameObject.Find("PlayerSpider"); if ((Object)(object)val6 != (Object)null) { if ((Object)(object)val6.transform.parent != (Object)null) { val6.transform.SetParent((Transform)null, true); } val6.transform.localScale = Vector3.one; Transform transform = val6.transform; transform.position += Vector3.up * 0.25f; } Vector3 dragStartVal = _dragStartVal; ((Vector3)(ref dragStartVal))[_dragAxis] = Mathf.Max(0.05f, ((Vector3)(ref _dragStartVal))[_dragAxis] + num4); selectedObject.transform.localScale = dragStartVal; } } } Physics.SyncTransforms(); } else { if (!flag) { return; } float num5 = (float)Screen.height - mouseScreenPos.y; if (num5 <= 115f || (PrefabSpawner.IsOpen && mouseScreenPos.x >= 20f && mouseScreenPos.x <= 460f && num5 >= 120f && num5 <= 535f) || (_showMapList && mouseScreenPos.x >= (float)Screen.width - 275f && num5 >= 115f && num5 <= 385f)) { return; } if ((Object)(object)selectedObject != (Object)null) { List<Transform> list2 = ((_mode == ToolMode.Rotate) ? _rotRings : _gizmoAxes); float num6 = default(float); float num7 = default(float); foreach (RaycastHit item in from h in Physics.RaycastAll(val, 500f, -1, (QueryTriggerInteraction)2) orderby ((RaycastHit)(ref h)).distance select h) { RaycastHit current = item; foreach (int item2 in Enumerable.Range(0, 3)) { if (!((RaycastHit)(ref current)).transform.IsChildOf(list2[item2])) { continue; } _dragAxis = item2; if (_mode == ToolMode.Rotate) { _dragStartRot = selectedObject.transform.rotation; _dragPlane = new Plane(list[item2], selectedObject.transform.position); ((Plane)(ref _dragPlane)).Raycast(val, ref num6); val3 = ((Ray)(ref val)).GetPoint(num6) - selectedObject.transform.position; _dragStartDir = ((Vector3)(ref val3)).normalized; return; } _dragStartVal = ((_mode == ToolMode.Move) ? selectedObject.transform.position : selectedObject.transform.localScale); Vector3 val7 = ((_mode == ToolMode.Resize) ? selectedObject.transform.TransformDirection(list[item2]) : list[item2]); val3 = Vector3.Cross(val7, Vector3.Cross(((Component)activeCam).transform.forward, val7)); Vector3 val8 = ((Vector3)(ref val3)).normalized; if (((Vector3)(ref val8)).sqrMagnitude == 0f) { val8 = -((Component)activeCam).transform.forward; } _dragPlane = new Plane(val8, selectedObject.transform.position); ((Plane)(ref _dragPlane)).Raycast(val, ref num7); _dragHitOffset = ((Ray)(ref val)).GetPoint(num7) - selectedObject.transform.position; return; } } } RaycastHit val9 = (from h in Physics.RaycastAll(val, 500f, -1, (QueryTriggerInteraction)2) where !((RaycastHit)(ref h)).transform.IsChildOf(_moveGizmoRoot.transform) && !((RaycastHit)(ref h)).transform.IsChildOf(_rotGizmoRoot.transform) orderby ((RaycastHit)(ref h)).distance select h).FirstOrDefault(); if ((Object)(object)((RaycastHit)(ref val9)).collider != (Object)null) { GameObject gameObject = ((Component)((RaycastHit)(ref val9)).collider).gameObject; Transform val10 = gameObject.transform; while ((Object)(object)val10.parent != (Object)null) { string name = ((Object)val10.parent).name; if (name.EndsWith("_Spawned") || name.EndsWith("_Clone") || name.IndexOf("door", StringComparison.OrdinalIgnoreCase) >= 0) { gameObject = ((Component)val10.parent).gameObject; break; } if ((Object)(object)val10.parent.parent != (Object)null && val10.parent.childCount <= 3 && !((Object)val10.parent).name.Contains("Environment") && !((Object)val10.parent).name.Contains("Room")) { gameObject = ((Component)val10.parent).gameObject; } val10 = val10.parent; } Plugin.SelectedObject = gameObject; _status = "Selected: " + ((Object)gameObject).name; return; } GameObject val11 = null; float num8 = 500f; Renderer[] array = Object.FindObjectsByType<Renderer>((FindObjectsSortMode)0); float num10 = default(float); foreach (Renderer val12 in array) { if (!val12.enabled || !((Component)val12).gameObject.activeInHierarchy || ((Component)val12).transform.IsChildOf(_moveGizmoRoot.transform) || ((Component)val12).transform.IsChildOf(_rotGizmoRoot.transform)) { continue; } string name2 = ((Object)((Component)val12).gameObject).name; if (name2.StartsWith("Solid") || name2 == "PlayerStart" || name2.EndsWith("_Spawned") || name2.EndsWith("_Clone")) { Bounds bounds = val12.bounds; if (((Bounds)(ref bounds)).IntersectRay(val, ref num10) && num10 >= 0f && num10 < num8) { num8 = num10; val11 = ((Component)val12).gameObject; } } } if ((Object)(object)val11 != (Object)null) { Plugin.SelectedObject = val11; _status = "Selected: " + ((Object)val11).name; } else { Plugin.SelectedObject = null; _status = "Deselected (Click Resume or F12 to play)."; } } } private void UpdateGizmoTransform() { //IL_008f: 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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_015c: 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) //IL_019e: 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_0106: Unknown result type (might be due to invalid IL or missing references) GameObject selectedObject = Plugin.SelectedObject; Camera activeCam = ActiveCam; if (!IsOpen || (Object)(object)selectedObject == (Object)null) { _moveGizmoRoot.SetActive(false); _rotGizmoRoot.SetActive(false); return; } bool flag = _mode == ToolMode.Rotate; _moveGizmoRoot.SetActive(!flag); _rotGizmoRoot.SetActive(flag); Transform val = (flag ? _rotGizmoRoot.transform : _moveGizmoRoot.transform); val.position = selectedObject.transform.position; val.rotation = ((_mode == ToolMode.Resize) ? selectedObject.transform.rotation : Quaternion.identity); if (!flag) { foreach (int item in Enumerable.Range(0, 3)) { _gizmoTips[item].localScale = ((_mode == ToolMode.Resize) ? new Vector3(0.46f, 0.46f, 0.46f) : new Vector3(0.34f, 0.34f, 0.34f)); } } if ((Object)(object)activeCam != (Object)null) { float num = (_is2DMode ? (_orthoSize * 1.4f) : Vector3.Distance(((Component)activeCam).transform.position, selectedObject.transform.position)); val.localScale = Vector3.one * Mathf.Clamp(num * 0.24f, 0.85f, 6f); } } private void OnRenderObject() { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_019f: 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_01a8: 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_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: 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_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: 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_01f1: 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_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_020a: 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_0213: Unknown result type (might be due to invalid IL or missing references) //IL_021b: 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_0227: 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_0235: 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_0245: 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_0251: 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_025f: Unknown result type (might be due to invalid IL or missing references) //IL_0267: 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_0276: 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_0287: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_0290: 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_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: 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_02c7: 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_02d8: 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_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: 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_0328: Unknown result type (might be due to invalid IL or missing references) //IL_033d: Unknown result type (might be due to invalid IL or missing references) if (!IsOpen || !_showColliders || (Object)(object)_wireMat == (Object)null) { return; } Physics.SyncTransforms(); _wireMat.SetPass(0); GL.Begin(1); GL.Color(Color.green); List<int> list = new List<int> { 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3 }; List<int> list2 = new List<int> { 1, 2, 3, 0, 5, 6, 7, 4, 4, 5, 6, 7 }; foreach (Collider cachedCollider in _cachedColliders) { if ((Object)(object)cachedCollider == (Object)null || !cachedCollider.enabled || !((Component)cachedCollider).gameObject.activeInHierarchy || ((Component)cachedCollider).transform.IsChildOf(_moveGizmoRoot.transform) || ((Component)cachedCollider).transform.IsChildOf(_rotGizmoRoot.transform)) { continue; } Bounds bounds = cachedCollider.bounds; Vector3 center = ((Bounds)(ref bounds)).center; Vector3 extents = ((Bounds)(ref bounds)).extents; List<Vector3> list3 = new List<Vector3> { center + new Vector3(0f - extents.x, 0f - extents.y, 0f - extents.z), center + new Vector3(extents.x, 0f - extents.y, 0f - extents.z), center + new Vector3(extents.x, 0f - extents.y, extents.z), center + new Vector3(0f - extents.x, 0f - extents.y, extents.z), center + new Vector3(0f - extents.x, extents.y, 0f - extents.z), center + new Vector3(extents.x, extents.y, 0f - extents.z), center + new Vector3(extents.x, extents.y, extents.z), center + new Vector3(0f - extents.x, extents.y, extents.z) }; foreach (int item in Enumerable.Range(0, 12)) { GL.Vertex(list3[list[item]]); GL.Vertex(list3[list2[item]]); } } GL.End(); } private void OnGUI() { //IL_002b: 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_008e: 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_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0172: 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_01d1: 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_0220: 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_025b: 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_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_03be: Unknown result type (might be due to invalid IL or missing references) //IL_03f0: Unknown result type (might be due to invalid IL or missing references) //IL_0427: Unknown result type (might be due to invalid IL or missing references) //IL_082d: Unknown result type (might be due to invalid IL or missing references) //IL_0858: Unknown result type (might be due to invalid IL or missing references) //IL_0893: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_08c5: Unknown result type (might be due to invalid IL or missing references) //IL_04e7: 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_0503: Unknown result type (might be due to invalid IL or missing references) //IL_0913: Unknown result type (might be due to invalid IL or missing references) //IL_092e: Unknown result type (might be due to invalid IL or missing references) //IL_0949: Unknown result type (might be due to invalid IL or missing references) //IL_0964: Unknown result type (might be due to invalid IL or missing references) //IL_097f: Unknown result type (might be due to invalid IL or missing references) //IL_099a: Unknown result type (might be due to invalid IL or missing references) //IL_09b5: Unknown result type (might be due to invalid IL or missing references) //IL_09d0: Unknown result type (might be due to invalid IL or missing references) //IL_09eb: Unknown result type (might be due to invalid IL or missing references) //IL_056b: Unknown result type (might be due to invalid IL or missing references) //IL_0545: Unknown result type (might be due to invalid IL or missing references) //IL_0625: Unknown result type (might be due to invalid IL or missing references) //IL_058b: Unknown result type (might be due to invalid IL or missing references) //IL_0590: Unknown result type (might be due to invalid IL or missing references) //IL_059a: Unknown result type (might be due to invalid IL or missing references) //IL_059f: Unknown result type (might be due to invalid IL or missing references) //IL_05aa: Unknown result type (might be due to invalid IL or missing references) //IL_065d: Unknown result type (might be due to invalid IL or missing references) //IL_0a8f: Unknown result type (might be due to invalid IL or missing references) //IL_0ab2: Unknown result type (might be due to invalid IL or missing references) //IL_06d6: Unknown result type (might be due to invalid IL or missing references) //IL_0b43: Unknown result type (might be due to invalid IL or missing references) //IL_0737: Unknown result type (might be due to invalid IL or missing references) //IL_0add: Unknown result type (might be due to invalid IL or missing references) //IL_0b8f: Unknown result type (might be due to invalid IL or missing references) //IL_07b1: Unknown result type (might be due to invalid IL or missing references) if (!IsOpen) { return; } float num = Screen.width; GUI.Box(new Rect(0f, 0f, num, 112f), ""); if (GUI.Button(new Rect(10f, 8f, 66f, 26f), (_mode == ToolMode.Move) ? "▶ Move" : "Move")) { _mode = ToolMode.Move; } if (GUI.Button(new Rect(80f, 8f, 72f, 26f), (_mode == ToolMode.Rotate) ? "▶ Rotate" : "Rotate")) { _mode = ToolMode.Rotate; } if (GUI.Button(new Rect(156f, 8f, 72f, 26f), (_mode == ToolMode.Resize) ? "▶ Resize" : "Resize")) { _mode = ToolMode.Resize; } if (GUI.Button(new Rect(232f, 8f, 54f, 26f), "+ Cube")) { SpawnShape((PrimitiveType)3, angledRamp: false); } if (GUI.Button(new Rect(290f, 8f, 54f, 26f), "+ Ramp")) { SpawnShape((PrimitiveType)3, angledRamp: true); } if (GUI.Button(new Rect(348f, 8f, 64f, 26f), "+ Cylinder")) { SpawnShape((PrimitiveType)2, angledRamp: false); } if (GUI.Button(new Rect(416f, 8f, 60f, 26f), "+ Sphere")) { SpawnShape((PrimitiveType)0, angledRamp: false); } GUI.backgroundColor = new Color(1f, 0.35f, 0.35f); if (GUI.Button(new Rect(480f, 8f, 76f, 26f), "+ Kill Block")) { PlaceKillBlock(); } if (GUI.Button(new Rect(560f, 8f, 64f, 26f), "+ Spear")) { PlaceKillSpear(); } GUI.backgroundColor = Color.white; if (GUI.Button(new Rect(628f, 8f, 88f, 26f), "+ Player Start")) { PlacePlayerStart(); } if (GUI.Button(new Rect(720f, 8f, 88f, 26f), "+ Checkpoint")) { PlaceCheckpoint(); } if (GUI.Button(new Rect(812f, 8f, 96f, 26f), PrefabSpawner.IsOpen ? "▶ Game Assets" : "+ Game Assets")) { PrefabSpawner prefabSpawner = Object.FindFirstObjectByType<PrefabSpawner>(); if ((Object)(object)prefabSpawner != (Object)null) { prefabSpawner.ToggleOpen(!PrefabSpawner.IsOpen); } } if (GUI.Button(new Rect(912f, 8f, 88f, 26f), _showColliders ? "Colliders: ON" : "Colliders: OFF")) { _showColliders = !_showColliders; if (_showColliders) { _cachedColliders = Object.FindObjectsByType<Collider>((FindObjectsSortMode)0).ToList(); } } if (GUI.Button(new Rect(1004f, 8f, 72f, 26f), _is2DMode ? "View: 2D" : "View: 3D")) { Toggle2DMode(); } if (GUI.Button(new Rect(1080f, 8f, 80f, 26f), "Clear Level")) { ClearLevel(); } if (GUI.Button(new Rect(num - 118f, 8f, 108f, 26f), "Resume (F12)")) { SetEditorOpen(open: false); } GameObject selectedObject = Plugin.SelectedObject; GUI.Label(new Rect(12f, 44f, 200f, 22f), "Target: " + (((Object)(object)selectedObject != (Object)null) ? ((Object)selectedObject).name : "(Click 3D Object)")); if ((Object)(object)selectedObject != (Object)null) { if ((Object)(object)selectedObject.transform.parent != (Object)null && GUI.Button(new Rect(216f, 42f, 92f, 26f), "Select Parent ▲")) { Plugin.SelectedObject = ((Component)selectedObject.transform.parent).gameObject; _status = "Parent: " + ((Object)Plugin.SelectedObject).name; } if (GUI.Button(new Rect(312f, 42f, 46f, 26f), "Flat")) { selectedObject.transform.rotation = Quaternion.identity; Physics.SyncTransforms(); } if (GUI.Button(new Rect(362f, 42f, 70f, 26f), "Reset Size")) { selectedObject.transform.localScale = Vector3.one; Physics.SyncTransforms(); } if (GUI.Button(new Rect(436f, 42f, 56f, 26f), "Clone")) { GameObject val = Object.Instantiate<GameObject>(selectedObject, selectedObject.transform.position + Vector3.up * 0.6f, selectedObject.transform.rotation); ((Object)val).name = ((Object)selectedObject).name + "_Clone"; RegisterSpawned(val); Plugin.SelectedObject = val; Physics.SyncTransforms(); _cachedColliders = Object.FindObjectsByType<Collider>((FindObjectsSortMode)0).ToList(); _status = "Cloned '" + ((Object)val).name + "'!"; } if (GUI.Button(new Rect(496f, 42f, 68f, 26f), "To Silky")) { Plugin.SummonToPlayer(selectedObject); Physics.SyncTransforms(); } if (GUI.Button(new Rect(568f, 42f, 58f, 26f), "Delete")) { if ((Object)(object)selectedObject == (Object)(object)_playerStartObj) { _playerStartObj = null; } SpawnedObjects.Remove(selectedObject); Object.Destroy((Object)(object)selectedObject); Plugin.SelectedObject = null; _cachedColliders = Object.FindObjectsByType<Collider>((FindObjectsSortMode)0).ToList(); _status = "Deleted!"; } if (GUI.Button(new Rect(630f, 42f, 78f, 26f), "+ Collision")) { int num2 = BuildSolidCollision(selectedObject); _cachedColliders = Object.FindObjectsByType<Collider>((FindObjectsSortMode)0).ToList(); _status = $"Built {num2} solid collider(s) on '{((Object)selectedObject).name}'!"; } if (GUI.Button(new Rect(712f, 42f, 78f, 26f), "- Collision")) { int num3 = RemoveAllCollision(selectedObject); _cachedColliders = Object.FindObjectsByType<Collider>((FindObjectsSortMode)0).ToList(); _status = $"Removed {num3} collider(s) from '{((Object)selectedObject).name}'!"; } bool flag = WalkableLayer != 0 && selectedObject.layer == WalkableLayer; if (GUI.Button(new Rect(794f, 42f, 78f, 26f), flag ? "Web: ON" : "Web: OFF")) { SetWebbable(selectedObject, !flag); _status = ((!flag) ? ("'" + ((Object)selectedObject).name + "' is now WEBBABLE!") : ("'" + ((Object)selectedObject).name + "' is now UNWEBBABLE!")); } } _mapName = GUI.TextField(new Rect(num - 385f, 43f, 125f, 24f), _mapName); if (GUI.Button(new Rect(num - 255f, 42f, 74f, 26f), "Save Map")) { SaveMap(); RefreshSavedMaps(); } if (GUI.Button(new Rect(num - 177f, 42f, 76f, 26f), "Load Map")) { LoadMap(); } if (GUI.Button(new Rect(num - 97f, 42f, 85f, 26f), _showMapList ? "Maps ▲" : "Maps ▼")) { _showMapList = !_showMapList; if (_showMapList) { RefreshSavedMaps(); } } List<Color> list = new List<Color> { Color.white, new Color(0.95f, 0.25f, 0.25f), new Color(1f, 0.55f, 0.1f), new Color(1f, 0.9f, 0.2f), new Color(0.25f, 0.85f, 0.35f), new Color(0.2f, 0.85f, 0.95f), new Color(0.25f, 0.5f, 1f), new Color(0.75f, 0.35f, 0.95f), new Color(0.22f, 0.24f, 0.28f) }; List<string> list2 = new List<string> { "Wht", "Red", "Org", "Yel", "Grn", "Cyn", "Blu", "Pur", "Drk" }; foreach (int item in Enumerable.Range(0, list.Count)) { GUI.backgroundColor = list[item]; if (GUI.Button(new Rect((float)(12 + item * 42), 76f, 38f, 24f), list2[item]) && (Object)(object)selectedObject != (Object)null) { ApplyColor(selectedObject, list[item]); _status = "Painted '" + ((Object)selectedObject).name + "' " + list2[item] + "!"; } } GUI.backgroundColor = Color.white; string text = (_hasActiveCheckpoint ? "Spawn: Checkpoint" : (((Object)(object)_playerStartObj != (Object)null) ? "Spawn: PlayerStart" : "Spawn: Default")); GUI.Label(new Rect(400f, 78f, num - 414f, 24f), _status + " | " + text + " | " + (_is2DMode ? "2D" : "3D")); if (_showMapList) { DrawSavedMapsWindow(num); } } public static void ApplyColor(GameObject target, Color col) { //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: 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) if ((Object)(object)target == (Object)null) { return; } if ((Object)(object)_cachedLitShader == (Object)null) { _cachedLitShader = Shader.Find("Universal Render Pipeline/Lit") ?? Shader.Find("Universal Render Pipeline/Simple Lit") ?? Shader.Find("Standard"); } Renderer[] componentsInChildren = target.GetComponentsInChildren<Renderer>(true); foreach (Renderer val in componentsInChildren) { if (!((Object)(object)val == (Object)null)) { Material val2 = new Material(((Object)(object)_cachedLitShader != (Object)null) ? _cachedLitShader : val.sharedMaterial.shader); if (val2.HasProperty("_BaseColor")) { val2.SetColor("_BaseColor", col); } if (val2.HasProperty("_Color")) { val2.SetColor("_Color", col); } val2.color = col; val.material = val2; } } } public static void SetWebbable(GameObject target, bool canWeb) { if (!((Object)(object)target == (Object)null)) { int layer = ((canWeb && WalkableLayer != 0) ? WalkableLayer : 0); string tag = ((canWeb && WalkableLayer != 0) ? WalkableTag : "Untagged"); Transform[] componentsInChildren = target.GetComponentsInChildren<Transform>(true); foreach (Transform val in componentsInChildren) { ((Component)val).gameObject.layer = layer; ((Component)val).gameObject.tag = tag; } } } private string GetMapSavePath() { string text = Path.Combine(Paths.PluginPath, "debugunlocker", "CustomMaps"); Directory.CreateDirectory(text); string text2 = (string.IsNullOrWhiteSpace(_mapName) ? "MyCustomMap" : _mapName.Trim()); return Path.Combine(text, text2 + ".json"); } public void SaveMap() { //IL_014c: 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_0151: 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_0156: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0394: 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_03a2: Unknown result type (might be due to invalid IL or missing references) //IL_03a7: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Unknown result type (might be due to invalid IL or missing references) //IL_03b5: 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_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Unknown result type (might be due to invalid IL or missing references) try { SpawnedObjects.RemoveAll((GameObject g) => (Object)(object)g == (Object)null); HashSet<GameObject> hashSet = new HashSet<GameObject>(SpawnedObjects); GameObject[] array = Object.FindObjectsByType<GameObject>((FindObjectsSortMode)0); foreach (GameObject val in array) { if (!((Object)(object)val == (Object)null) && val.activeInHierarchy && !((Object)(object)val == (Object)(object)_playerStartObj) && (((Object)val).name.StartsWith("Solid") || ((Object)val).name.EndsWith("_Spawned") || ((Object)val).name.EndsWith("_Clone")) && ((Object)(object)val.transform.parent == (Object)null || !hashSet.Contains(((Component)val.transform.parent).gameObject))) { hashSet.Add(val); } } CultureInfo invariantCulture = CultureInfo.InvariantCulture; StringBuilder stringBuilder = new StringBuilder(); stringBuilder.AppendLine("{"); bool flag = (Object)(object)_playerStartObj != (Object)null; Vector3 val2 = (flag ? _playerStartObj.transform.position : Vector3.zero); Quaternion val3 = (flag ? _playerStartObj.transform.rotation : Quaternion.identity); stringBuilder.AppendLine(" \"hasPlayerStart\": " + (flag ? "true" : "false") + ","); stringBuilder.AppendLine(" \"spx\": " + val2.x.ToString(invariantCulture) + ", \"spy\": " + val2.y.ToString(invariantCulture) + ", \"spz\": " + val2.z.ToString(invariantCulture) + ","); stringBuilder.AppendLine(" \"srx\": " + val3.x.ToString(invariantCulture) + ", \"sry\": " + val3.y.ToString(invariantCulture) + ", \"srz\": " + val3.z.ToString(invariantCulture) + ", \"srw\": " + val3.w.ToString(invariantCulture) + ","); stringBuilder.AppendLine(" \"items\": ["); List<string> list = new List<string>(); foreach (GameObject item in hashSet) { if ((Object)(object)item == (Object)null || !item.activeInHierarchy) { continue; } bool flag2 = ((Object)item).name.StartsWith("Solid"); string text = ((Object)item).name; while (text.EndsWith("_Spawned") || text.EndsWith("_Clone")) { if (text.EndsWith("_Spawned")) { text = text.Substring(0, text.Length - 8); } if (text.EndsWith("_Clone")) { text = text.Substring(0, text.Length - 6); } } int num2 = ((((Object)item).name.Contains("Cylinder") || ((Object)item).name.Contains("Checkpoint")) ? 2 : ((!((Object)item).name.Contains("Sphere")) ? 3 : 0)); Vector3 position = item.transform.position; Quaternion rotation = item.transform.rotation; Vector3 localScale = item.transform.localScale; Color val4 = (((Object)(object)item.GetComponentInChildren<Renderer>() != (Object)null) ? item.GetComponentInChildren<Renderer>().material.color : Color.white); bool flag3 = item.GetComponentsInChildren<Collider>(true).Any((Collider col) => col.enabled && !col.isTrigger); bool flag4 = WalkableLayer != 0 && item.layer == WalkableLayer; string text2 = ((Object)item).name.Replace("\"", "\\\""); string text3 = text.Replace("\"", "\\\""); list.Add(" {\n \"name\": \"" + text2 + "\",\n \"sourceName\": \"" + text3 + "\",\n \"isPrimitive\": " + (flag2 ? "true" : "false") + ",\n" + $" \"primType\": {num2},\n" + " \"px\": " + position.x.ToString(invariantCulture) + ", \"py\": " + position.y.ToString(invariantCulture) + ", \"pz\": " + position.z.ToString(invariantCulture) + ",\n \"rx\": " + rotation.x.ToString(invariantCulture) + ", \"ry\": " + rotation.y.ToString(invariantCulture) + ", \"rz\": " + rotation.z.ToString(invariantCulture) + ", \"rw\": " + rotation.w.ToString(invariantCulture) + ",\n \"sx\": " + localScale.x.ToString(invariantCulture) + ", \"sy\": " + localScale.y.ToString(invariantCulture) + ", \"sz\": " + localScale.z.ToString(invariantCulture) + ",\n \"cr\": " + val4.r.ToString(invariantCulture) + ", \"cg\": " + val4.g.ToString(invariantCulture) + ", \"cb\": " + val4.b.ToString(invariantCulture) + ",\n \"hasCollision\": " + (flag3 ? "true" : "false") + ",\n \"webbable\": " + (flag4 ? "true" : "false") + "\n }"); } stringBuilder.AppendLine(string.Join(",\n", list)); stringBuilder.AppendLine(" ]"); stringBuilder.AppendLine("}"); string mapSavePath = GetMapSavePath(); File.WriteAllText(mapSavePath, stringBuilder.ToString()); _status = $"Saved '{Path.GetFileName(mapSavePath)}' ({list.Count} objects)!"; } catch (Exception ex) { _status = "Save Error: " + ex.Message; } } public void LoadMap() { //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_016e: 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_02d8: Expected O, but got Unknown //IL_03c2: Unknown result type (might be due to invalid IL or missing references) //IL_03e3: 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_0431: Unknown result type (might be due to invalid IL or missing references) try { string mapSavePath = GetMapSavePath(); if (!File.Exists(mapSavePath)) { _status = "Not found: CustomMaps/" + Path.GetFileName(mapSavePath); return; } string text = File.ReadAllText(mapSavePath); foreach (GameObject spawnedObject in SpawnedObjects) { if ((Object)(object)spawnedObject != (Object)null && (Object)(object)spawnedObject != (Object)(object)_playerStartObj) { Object.Destroy((Object)(object)spawnedObject); } } SpawnedObjects.Clear(); _hasActiveCheckpoint = false; Plugin.SelectedObject = null; if (text.Contains("\"hasPlayerStart\": true")) { PlacePlayerStart(); float num = ExtractFloat(text, "spx"); float num2 = ExtractFloat(text, "spy"); float num3 = ExtractFloat(text, "spz"); float num4 = ExtractFloat(text, "srx"); float num5 = ExtractFloat(text, "sry"); float num6 = ExtractFloat(text, "srz"); float num7 = ExtractFloat(text, "srw", 1f); _playerStartObj.transform.SetPositionAndRotation(new Vector3(num, num2, num3), new Quaternion(num4, num5, num6, num7)); } Dictionary<string, GameObject> dictionary = new Dictionary<string, GameObject>(StringComparer.OrdinalIgnoreCase); GameObject[] array = Resources.FindObjectsOfTypeAll<GameObject>(); foreach (GameObject val in array) { if (!((Object)(object)val == (Object)null) && !((Object)val).name.EndsWith("_Spawned") && !((Object)val).name.EndsWith("_Clone") && !dictionary.ContainsKey(((Object)val).name)) { dictionary[((Object)val).name] = val; } } int num8 = 0; int num9 = 0; int num10 = text.IndexOf("\"items\""); if (num10 >= 0) { string input = text.Substring(num10); foreach (Match item in Regex.Matches(input, "\\{[^{}]*\\}")) { SavedMapItem savedMapItem = JsonUtility.FromJson<SavedMapItem>(item.Value); if (savedMapItem == null || string.IsNullOrEmpty(savedMapItem.name)) { continue; } GameObject val2 = null; if (savedMapItem.isPrimitive) { if (savedMapItem.name.StartsWith("SolidKillSpear") || savedMapItem.sourceName == "SolidKillSpear") { val2 = new GameObject("SolidKillSpear"); MeshFilter val3 = val2.AddComponent<MeshFilter>(); val3.sharedMesh = CreateSpearMesh(); val2.AddComponent<MeshRenderer>(); MeshCollider val4 = val2.AddComponent<MeshCollider>(); val4.sharedMesh = val3.sharedMesh; val4.convex = true; } else { val2 = GameObject.CreatePrimitive((PrimitiveType)savedMapItem.primType); } } else { if (!dictionary.TryGetValue(savedMapItem.sourceName, out var value)) { num9++; continue; } val2 = Object.Instantiate<GameObject>(value); val2.SetActive(true); Transform[] componentsInChildren = val2.GetComponentsInChildren<Transform>(true); foreach (Transform val5 in componentsInChildren) { ((Component)val5).gameObject.SetActive(true); } } ((Object)val2).name = savedMapItem.name; val2.transform.SetPositionAndRotation(new Vector3(savedMapItem.px, savedMapItem.py, savedMapItem.pz), new Quaternion(savedMapItem.rx, savedMapItem.ry, savedMapItem.rz, savedMapItem.rw)); val2.transform.localScale = new Vector3(savedMapItem.sx, savedMapItem.sy, savedMapItem.sz); ApplyColor(val2, new Color(savedMapItem.cr, savedMapItem.cg, savedMapItem.cb, 1f)); RegisterSpawned(val2); bool canWeb = (item.Value.Contains("\"webbable\"") ? savedMapItem.webbable : (!savedMapItem.name.StartsWith("SolidKillBlock") && !savedMapItem.name.StartsWith("SolidKillSpear"))); SetWebbable(val2, canWeb); if (!savedMapItem.isPrimitive) { if (savedMapItem.hasCollision) { BuildSolidCollision(val2); } else { RemoveAllCollision(val2); } } else if (!savedMapItem.hasCollision) { RemoveAllCollision(val2); } num8++; } } Physics.SyncTransforms(); _cachedColliders = Object.FindObjectsByType<Collider>((FindObjectsSortMode)0).ToList(); _status = ((num9 > 0) ? $"Loaded {num8} objects ({num9} missing - click Load All Levels first!)" : $"Loaded '{Path.GetFileName(mapSavePath)}' ({num8} objects)!"); } catch (Exception ex) { _status = "Load Error: " + ex.Message; } } private float ExtractFloat(string json, string key, float fallback = 0f) { Match match = Regex.Match(json, "\"" + key + "\"\\s*:\\s*([-0-9.eE+]+)"); Group obj = (match.Success ? match.Groups.Cast<Group>().Skip(1).FirstOrDefault() : null); if (obj != null && float.TryParse(obj.Value, NumberStyles.Float, CultureInfo.InvariantCulture, out var result)) { return result; } return fallback; } private void RefreshSavedMaps() { string path = Path.Combine(Paths.PluginPath, "debugunlocker", "CustomMaps"); Directory.CreateDirectory(path); _savedMapFiles = (from f in Directory.GetFiles(path, "*.json") select Path.GetFileNameWithoutExtension(f) into n orderby n select n).ToList(); } private void DrawSavedMapsWindow(float screenW) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0084: 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_00af: 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_00b9: 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) float num = 260f; float num2 = 260f; float num3 = screenW - num - 12f; float num4 = 116f; GUI.Box(new Rect(num3, num4, num, num2), "Saved Custom Maps"); if (GUI.Button(new Rect(num3 + num - 64f, num4 + 4f, 56f, 20f), "Refresh")) { RefreshSavedMaps(); } _mapListScroll = GUI.BeginScrollView(new Rect(num3 + 8f, num4 + 30f, num - 16f, num2 - 38f), _mapListScroll, new Rect(0f, 0f, num - 36f, (float)(_savedMapFiles.Count * 28))); foreach (int item in Enumerable.Range(0, _savedMapFiles.Count)) { string text = _savedMapFiles[item]; if (GUI.Button(new Rect(0f, (float)(item * 28), num - 36f, 25f), text)) { _mapName = text; _showMapList = false; LoadMap(); } } GUI.EndScrollView(); } private void PlaceKillBlock() { //IL_0028: 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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0011: 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_0047: 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_007d: 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) Camera activeCam = ActiveCam; Vector3 position = (((Object)(object)activeCam != (Object)null) ? (((Component)activeCam).transform.position + ((Component)activeCam).transform.forward * 4f) : (Vector3.up * 2f)); GameObject val = GameObject.CreatePrimitive((PrimitiveType)3); ((Object)val).name = "SolidKillBlock"; val.transform.position = position; val.transform.localScale = new Vector3(3f, 0.5f, 3f); ApplyColor(val, new Color(0.95f, 0.12f, 0.12f)); RegisterSpawned(val); SetWebbable(val, canWeb: false); Physics.SyncTransforms(); Plugin.SelectedObject = val; _cachedColliders = Object.FindObjectsByType<Collider>((FindObjectsSortMode)0).ToList(); _status = "Placed Kill Block (unwebbable — touching it respawns Silky)!"; } private void PlaceKillSpear() { //IL_0028: 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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0011: 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_0047: 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_0053: Expected O, but got Unknown //IL_0059: 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_00c9: Unknown result type (might be due to invalid IL or missing references) Camera activeCam = ActiveCam; Vector3 position = (((Object)(object)activeCam != (Object)null) ? (((Component)activeCam).transform.position + ((Component)activeCam).transform.forward * 4f) : (Vector3.up * 2f)); GameObject val = new GameObject("SolidKillSpear"); val.transform.position = position; val.transform.localScale = new Vector3(1.4f, 2.6f, 1.4f); MeshFilter val2 = val.AddComponent<MeshFilter>(); val2.sharedMesh = CreateSpearMesh(); val.AddComponent<MeshRenderer>(); MeshCollider val3 = val.AddComponent<MeshCollider>(); val3.sharedMesh = val2.sharedMesh; val3.convex = true; ApplyColor(val, new Color(1f, 0.18f, 0.12f)); RegisterSpawned(val); SetWebbable(val, canWeb: false); Physics.SyncTransforms(); Plugin.SelectedObject = val; _cachedColliders = Object.FindObjectsByType<Collider>((FindObjectsSortMode)0).ToList(); _status = "Placed Kill Spear (rotate or scale to point anywhere)!"; } private static Mesh CreateSpearMesh() { //IL_0019: 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_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Expected O, but got Unknown int num = 16; List<Vector3> list = new List<Vector3> { new Vector3(0f, 0.5f, 0f), new Vector3(0f, -0.5f, 0f) }; foreach (int item3 in Enumerable.Range(0, num)) { float num2 = (float)item3 * 2f * MathF.PI / (float)num; list.Add(new Vector3(Mathf.Cos(num2) * 0.5f, -0.5f, Mathf.Sin(num2) * 0.5f)); } List<int> list2 = new List<int>(); foreach (int item4 in Enumerable.Range(0, num)) { int item = item4 + 2; int item2 = (item4 + 1) % num + 2; list2.Add(0); list2.Add(item2); list2.Add(item); list2.Add(1); list2.Add(item); list2.Add(item2); } Mesh val = new Mesh { name = "SpearConeMesh" }; val.SetVertices(list); val.SetTriangles(list2, 0); val.RecalculateNormals(); val.RecalculateBounds(); return val; } private void PlaceCheckpoint() { //IL_0028: 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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0011: 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_0047: 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_007d: 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) Camera activeCam = ActiveCam; Vector3 position = (((Object)(object)activeCam != (Object)null) ? (((Component)activeCam).transform.position + ((Component)activeCam).transform.forward * 3.5f) : (Vector3.up * 1.5f)); GameObject val = GameObject.CreatePrimitive((PrimitiveType)2); ((Object)val).name = "SolidCheckpoint"; val.transform.position = position; val.transform.localScale = new Vector3(2.2f, 0.15f, 2.2f); ApplyColor(val, new Color(0.65f, 1f, 0.15f)); RegisterSpawned(val); SetWebbable(val, canWeb: true); Physics.SyncTransforms(); Plugin.SelectedObject = val; _cachedColliders = Object.FindObjectsByType<Collider>((FindObjectsSortMode)0).ToList(); _status = "Placed Checkpoint Pad (step on it while playing to save spawn)!"; } private void CheckCheckpointsAndRespawn(object kb) { //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_01e4: 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_011c: 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_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_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: 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_014a: Unknown result type (might be due to invalid IL or missing references) //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_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016e: 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_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019b: 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) GameObject val = GameObject.Find("PlayerSpider"); if ((Object)(object)val == (Object)null) { return; } Vector3 position = val.transform.position; foreach (GameObject spawnedObject in SpawnedObjects) { if ((Object)(object)spawnedObject == (Object)null || !spawnedObject.activeInHierarchy) { continue; } if (((Object)spawnedObject).name.StartsWith("SolidKillBlock") || ((Object)spawnedObject).name.StartsWith("SolidKillSpear")) { Collider component = spawnedObject.GetComponent<Collider>(); if ((Object)(object)component != (Object)null) { Vector3 val2 = component.ClosestPoint(position); if (Vector3.Distance(position, val2) <= 0.35f && (_hasActiveCheckpoint || (Object)(object)_playerStartObj != (Object)null)) { RespawnAtCheckpoint(val); return; } } } else { if (!((Object)spawnedObject).name.StartsWith("SolidCheckpoint")) { continue; } float num = Vector3.Distance(position, spawnedObject.transform.position); if (num <= 2.2f) { Vector3 val3 = spawnedObject.transform.position + Vector3.up * 0.6f; if (!_hasActiveCheckpoint || Vector3.Distance(_activeCheckpointPos, val3) > 0.5f) { _activeCheckpointPos = val3; _activeCheckpointRot = spawnedObject.transform.rotation; _hasActiveCheckpoint = true; ApplyColor(spawnedObject, new Color(0.15f, 1f, 0.55f)); } } } } if (position.y < -120f && (_hasActiveCheckpoint || (Object)(object)_playerStartObj != (Object)null)) { RespawnAtCheckpoint(val); } } private void RespawnAtCheckpoint(GameObject spider) { //IL_0030: 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_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_0028: 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_0051: 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_0056: 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_008b: 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) Vector3 val = (_hasActiveCheckpoint ? _activeCheckpointPos : (_playerStartObj.transform.position + Vector3.up * 0.5f)); Quaternion val2 = (_hasActiveCheckpoint ? _activeCheckpointRot : _playerStartObj.transform.rotation); spider.transform.SetPositionAndRotation(val, val2); Rigidbody[] componentsInChildren = spider.GetComponentsInChildren<Rigidbody>(true); foreach (Rigidbody val3 in componentsInChildren) { if (!val3.isKinematic) { val3.linearVelocity = Vector3.zero; val3.angularVelocity = Vector3.zero; } } } private void PlacePlayerStart() { //IL_0038: 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_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_0057: 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_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_00f6: 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_00b1: 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_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_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0141: 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) Camera activeCam = ActiveCam; Vector3 position = (((Object)(object)activeCam != (Object)null) ? (((Component)activeCam).transform.position + ((Component)activeCam).transform.forward * 3.5f) : (_hasDefaultSpawn ? _defaultSpawnPos : (Vector3.up * 1.5f))); if ((Object)(object)_playerStartObj == (Object)null) { _playerStartObj = GameObject.CreatePrimitive((PrimitiveType)2); ((Object)_playerStartObj).name = "PlayerStart"; _playerStartObj.transform.localScale = new Vector3(1.1f, 0.12f, 1.1f); ApplyColor(_playerStartObj, Color.cyan); Collider component = _playerStartObj.GetComponent<Collider>(); if ((Object)(object)component != (Object)null) { component.isTrigger = true; } } _playerStartObj.SetActive(true); _playerStartObj.transform.position = position; if ((Object)(object)activeCam != (Object)null) { Vector3 val = Vector3.ProjectOnPlane(((Component)activeCam).transform.forward, Vector3.up); if (((Vector3)(ref val)).sqrMagnitude > 0.01f) { _playerStartObj.transform.rotation = Quaternion.LookRotation(val); } } Physics.SyncTransforms(); Plugin.SelectedObject = _playerStartObj; _status = "Placed PlayerStart (hidden while playing)!"; } private void ClearLevel() { //IL_0136: 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) GameObject val = GameObject.Find("PlayerSpider"); if ((Object)(object)val != (Object)null && (Object)(object)val.transform.parent != (Object)null) { val.transform.SetParent((Transform)null, true); } Transform val2 = (((Object)(object)val != (Object)null) ? val.transform.root : null); List<string> source = new List<string> { "PlayerSpider", "TargetTransform", "InputTransform", "Camera", "Cinemachine", "Light", "Directional", "EventSystem", "Manager", "System", "Console", "MapEditor", "Player", "Spider", "UI", "HUD", "Canvas", "Audio" }; int num = 0; Scene activeScene = SceneManager.GetActiveScene(); GameObject[] rootGameObjects = ((Scene)(ref activeScene)).GetRootGameObjects(); foreach (GameObject root in rootGameObjects) { if (!root.activeSelf || (Object)(object)root == (Object)(object)((Component)this).gameObject || (Object)(object)root == (Object)(object)_moveGizmoRoot || (Object)(object)root == (Object)(object)_rotGizmoRoot || ((Object)(object)_editorCam != (Object)null && (Objec