Last active
September 7, 2019 13:55
-
-
Save joshcamas/9da8333b167ddf8f20691af994b9aade to your computer and use it in GitHub Desktop.
Disabling annoying "select all on focus" for EditorUI.TextArea
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
//Just set EditorGUI.s_SelectAllOnMouseUp (an internal variable) to false every frame / every time you draw. | |
//This variable is usually set to true in certain circumstances, so we're overwriting the value. | |
//I honestly don't know why this feature exists, it's quite annoying and never useful. | |
//Of course, be sure to cache the field! | |
selectAllField = typeof(EditorGUI).GetField("s_SelectAllOnMouseUp", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Default); | |
selectAllField.SetValue(null, false); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment