Last active
December 23, 2015 09:29
-
-
Save bamboo/6614827 to your computer and use it in GitHub Desktop.
Unity EditorWindow loses state if Scene view is maximized.
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
using UnityEditor; | |
public class WindowStateIsLostWhenViewIsMaximized : EditorWindow { | |
[MenuItem("Window/Bugs/Window State Is Lost When View Is Maximized")] | |
static void Open() { | |
EditorWindow.GetWindow<WindowStateIsLostWhenViewIsMaximized>(); | |
} | |
string _state; | |
// Steps to reproduce: | |
// 1. Open this window | |
// 2. Type something in the text field | |
// 3. Select the Scene view | |
// 4. Press <SPACE> to maximize it | |
// 5. Press <SPACE> to restore it | |
// 6. Text field lost its state | |
void OnGUI() { | |
_state = EditorGUILayout.TextField(_state ?? ""); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment