Search Unity

Issue with EditorWindow

Discussion in 'Scripting' started by Rukas90, Jun 10, 2019.

  1. Rukas90

    Rukas90

    Joined:
    Sep 20, 2015
    Posts:
    169
    Hello,
    I have this one issue and I don't know what's causing it.
    When I press on a particular button within my window, which opens a specific section, I make my editor window non-resizable. So I set the min and max window size to the current window size. Then after I exit that section, by pressing some exit button for example. I set the min size to the default minSize which is (100,100) and the max size to the default maxSize which is (4000,4000).

    But the problem is that after I make my window non-resizable, I am unable to resize my window even when I set the min and max back to default.

    I don't know if this makes any difference, but I am using the Utility editor window (ScriptableObject).
    Code (CSharp):
    1. [MenuItem("Window/My Window")]
    2.         public static void Open()
    3.         {
    4.             var window = ScriptableObject.CreateInstance(typeof(Main)) as Main;
    5.             window.titleContent = new GUIContent("My Window");
    6.             window.ShowUtility();
    7.         }
    Can someone give me some advice on what am I doing wrong here? Thank you