Insanely huge initial commit

This commit is contained in:
2026-02-21 17:04:05 -08:00
parent 9cdd36191a
commit 613d75914a
22525 changed files with 4035207 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
using System;
using System.Reflection;
using UnityEditor;
using UnityEngine;
namespace MoreMountains.Tools
{
/// <summary>
/// A simple class that lets you lock the current inspector by pressing ctrl (or cmd) + L
/// Pressing the same shortcut again unlocks the
/// </summary>
public class MMLockInspector : MonoBehaviour
{
[MenuItem("Tools/More Mountains/Lock Inspector %l")]
static public void LockInspector()
{
Type inspectorType = typeof(Editor).Assembly.GetType("UnityEditor.InspectorWindow");
EditorWindow inspectorWindow = EditorWindow.GetWindow(inspectorType);
PropertyInfo isLockedPropertyInfo = inspectorType.GetProperty("isLocked", BindingFlags.Public | BindingFlags.Instance);
bool state = (bool)isLockedPropertyInfo.GetGetMethod().Invoke(inspectorWindow, new object[] { });
isLockedPropertyInfo.GetSetMethod().Invoke(inspectorWindow, new object[] { !state });
}
}
}