Skip to content

Commit

Permalink
feat: Use MyBox inspector lock
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Aug 20, 2023
1 parent a0bbcae commit 968b3ee
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions Assets/JCSUnity/Editor/JCSUnity_Hotkeys.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,30 +46,6 @@ private static void SelectLockableInspector()
}
}

[MenuItem(MI_BaseName + "/Toggle Inspector Lock &w", false, MI_BasePriority + 50)]
private static void ToggleInspectorLock()
{
if (_mouseOverWindow == null)
{
if (!EditorPrefs.HasKey("LockableInspectorIndex"))
EditorPrefs.SetInt("LockableInspectorIndex", 0);
int i = EditorPrefs.GetInt("LockableInspectorIndex");

Type type = Assembly.GetAssembly(typeof(Editor)).GetType("UnityEditor.InspectorWindow");
Object[] findObjectsOfTypeAll = Resources.FindObjectsOfTypeAll(type);
_mouseOverWindow = (EditorWindow)findObjectsOfTypeAll[i];
}

if (_mouseOverWindow != null && _mouseOverWindow.GetType().Name == "InspectorWindow")
{
Type type = Assembly.GetAssembly(typeof(Editor)).GetType("UnityEditor.InspectorWindow");
PropertyInfo propertyInfo = type.GetProperty("isLocked");
bool value = (bool)propertyInfo.GetValue(_mouseOverWindow, null);
propertyInfo.SetValue(_mouseOverWindow, !value, null);
_mouseOverWindow.Repaint();
}
}

[MenuItem(MI_BaseName + "/Clear Console #&c", false, MI_BasePriority + 50)]
private static void ClearConsole()
{
Expand Down

0 comments on commit 968b3ee

Please sign in to comment.