Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question How to make a EditorWindow maximized with double click a blank area?

Discussion in 'Editor & General Support' started by KevinLi, Oct 19, 2022.

  1. KevinLi

    KevinLi

    Joined:
    Jul 9, 2014
    Posts:
    3
    I create a custom EditorWindow. In top left there is a maximize button. Now I want to make the same function with a double click operation to a blank area. I can't find anything in the document. Can Unity EditorWindow have this feature?
     
  2. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    6,015
    You can use the Event class in regular GUI code to check for input. Should be easy to see if there's two clicks in a short period of time.

    Not sure if UI Toolkit requires a different approach.
     
  3. KevinLi

    KevinLi

    Joined:
    Jul 9, 2014
    Posts:
    3
    I have try this, when I click a blank area I got a Event type "Used". It sound like is not a click event. And the EditorWindow.maximized propertie is not work when the window is undocked.

    "Setting maximized will make the Unity Editor as large as the Unity screen. If the window is undocked, this value will always be false and setting it will have no effect. This is handled by the GUILayout.Toggle option."