This commit is contained in:
SoulliesOfficial
2025-12-17 04:19:38 -05:00
parent 7c1cb7e8e1
commit d15957c719
4315 changed files with 8260710 additions and 2940 deletions

View File

@@ -0,0 +1,25 @@
using UnityEditor;
using UnityEngine;
namespace GraphicsCat
{
public class InspectorUtils
{
#if UNITY_EDITOR
public static void OpenLockedInspector(Object obj)
{
var lastActiveObject = Selection.activeObject;
Selection.activeObject = obj;
var inspectorType = typeof(UnityEditor.Editor).Assembly.GetType("UnityEditor.InspectorWindow");
var inspector = ScriptableObject.CreateInstance(inspectorType) as EditorWindow;
inspector.Show();
var isLockedProperty = inspectorType.GetProperty("isLocked");
isLockedProperty.SetValue(inspector, true);
Selection.activeObject = lastActiveObject;
}
#endif
}
}