- Home /
How to resize preference window to fit gui contents.
How would you reszie the preference window to fit gui contents? I am making an editor extension with some settings that I added to the preference window with the PreferenceItem attribute, however the window is a bit small for what I need. Is there a way to make sure it has a minimum size that fits my gui?
Thanks.
Answer by EdgarAllen · Mar 06, 2013 at 10:04 AM
Apparently the preference window is just another EditorWindow. For now I just cheated and used EditorWindow.GetWindow()
to grab the window and then check it's title for a match. Setting the window.minSize
does what I need, but if other extensions start doing the same, it could create a mess with everyone fighting over the window size. It all feels kind of hackish to me and I'm still on the lookout for a better solution.
Your answer
Follow this Question
Related Questions
Code executes more than once when key press event is triggered in OnGui in Custom Editor Window 3 Answers
Event.current not fired after BeginWindows() on an EditorWindow 0 Answers
EditorWindow & Handles Position/FreeMove/... 1 Answer
Huge Performance difference between docked and undocked EditorWindow 0 Answers
Detect EditorWindow.OnGUI vs. MonoBehaviour.OnGUI to facilitate code sharing? 2 Answers