Last active
March 10, 2022 12:25
-
-
Save SiarheiPilat/b1469fba1b4f5757b10c083e88dbedb2 to your computer and use it in GitHub Desktop.
Lets user lock the Inspector window using keyboard shortcut. Note: Does not work for multiple inspector windows!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---------------------------------------------------------------------------- | |
// Author: Siarhei Pilat | |
// Site: https://www.suasor-ab.com/ | |
// This gist: https://gist.github.com/SiarheiPilat/b1469fba1b4f5757b10c083e88dbedb2 | |
// Updated: 24 Feb 2021 | |
// ---------------------------------------------------------------------------- | |
using UnityEditor; | |
/// <summary> | |
/// Locks the inspector window with a shortcut. Works for a single inspector window. Need to restart the editor for it to work! | |
/// </summary> | |
static class InspectorLockShortcut | |
{ | |
[MenuItem("Tools/Toggle Inspector lock %l")] | |
static void ToggleInspectorLock() | |
{ | |
ActiveEditorTracker.sharedTracker.isLocked = !ActiveEditorTracker.sharedTracker.isLocked; | |
ActiveEditorTracker.sharedTracker.ForceRebuild(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment