Unity 2019.3 removed the UnityEditor.GameView.GetMainGameView internal api. You’ll need to make some changes to your code. The following works for me for the time-being.
public static EditorWindow GetMainGameView() {
var views = Types.GameView.GetFieldValue<object>("s_GameViews") as IList;
if (views.Count > 0)
return (EditorWindow)views[0];
return null;
}
Hi Lars, can you please provide your Unity version and the steps to reproduce this? I just tested the toolbar hiding in the latest alpha (2020.1.0a11) and it’s working fine.
The new update sounds amazing!
Does this update: “Added new option to keep utility windows in front of fullscreen editor windows.” means assets like Peek are supported? The fix you gave me is great but still not perfect. Maybe with this update will solve all the remaining issues.
I want the main view to always be at fullscreen.
Then I press f9 - f11 it fullscreens appropriate window and then I go back the main view always become in no fullscreen mode even if it was in fullscreen mode before. ( that is pointless, I do not want to turn the main view to fullscreen again after each switch). Your package should remember the fullscreen state of the main window and restore it back after switching the fullscreen mode of other windows. (possibly add the option to Keep main view in fullscreen).
Is there a way to keep main window fullscreen? Or is this planned?
I was able to keep the main view in fullscreen mode by adding below line into the end of each menu command in code
However it has flaws.
Then I make fullscreen any other window(from fullscreened main view) it firstly make main window into no fullscreen mode for 0.3 seconds and than goes to fullscreen mode. Same happens after making any fullscreen window into no fullscreen mode.
Main menu and unity window’s title bar whose have a bright white color is flickering during each switch. It is hurting eyes and is vary distracting and ugly and hence discorouge switching.
Also focused window removes focus and you can no longer constantly switch with F9 without clicking on window.
Suggestions.
Add option to hide bottom status bar.
Make so than you move your mouse close to screen’s top the main menu bar apper (in fullscrren mode of main view)( how it is made in Rider fullscreen mode). Same could be made for scene view toolbar.
Yes, it’s meant to be that way, it becomes quite confusing keeping a fullscreen on top of another when you need to close them.
My advice is to just press the key to create a new fullscreen, for example, if you’re on the Main View Fullscreen and changed to game view using F10, you can just go back by pressing F12.
Try that, if it doesn’t work for you I can change the coded so it doesn’t close other fullscreen windows when opening new ones.
I noticed this on newer versions of Unity, I’ve managed to get around this bug by adding a delay when changing the fullscreen. Just change the if statement by the one below on lines 136 and 155 on Fullscreen/Editor/Fullscreen.cs:
After.Milliseconds(500d, () => {
if (fullscreen)
fullscreen.Close();
});
This indeed seems to be a problem, I’ll look into it.
And I’ll take the two suggestions into account, they’re definitely good features.
Thanks for the feedback!
TextusGames said: ↑
1.
Also focused window removes focus and you can no longer constantly switch with F9 without clicking on window.
Just to be clear the losing focus on F9 is hapening only after my modifications. By default it is working as expected. (so you do not need to inverstigate here).
This fixes title bar menu flashing for F10- F11 only. Once you press F12 flashing still happens. So this does not solve flashing problem.
Pressing F12 is not solving my problem because:
It is confusing to use.
If I press it twice it leads to no fullscreen.
Sometimes I want to close window with the button I pressed before and it will still lead to no fullscreen.
Pressing F12 still provides tilte and menu flashing (even with code modifications your suggested).
You do not need to keep all opened windows fullscreen. But the main editor window should be always fullscreen once it is set fullscreen. No other menu manipulation should lead to resetting the fullscreen state of the main window. Overwise it is pointless. It is my main window I do not want to manually maintain the fullscreen state of it ( because every switch accidentally resets the state).
If you keep main window fullscreen there will be no title bar and main menu bright flashing problem automatically ( becouse it is allready fullscreen).
So you need to ensure that if main window is set fullscreen nothing else can change it. Please do it. 5. Is there a reason that there is now shortcat to close any fullscreen window (Except main editor window!) (Prefereably ESC)?
Than I first opened some window in fullscreen I spend some time to close it. I intuitevely pressed ESC 10 times:).
Edited. I found close all fullscreen shourtcut but it also closes main window fullscreen. Main windows fullscreen should be untuchable!
F8 should also show/hide main menu in main window fullscreen mode as it shows other window’s toolbars, at least for consistancy.
However, I strongly suggest to add setting’s option that changes toolbar/main menu behavior.
First is to switch visibility of toolbar/main menu by pressing F8. Second is to show toolbar/menu(or both) only if user’s mouse is in the top of the screen(this should be drawn on top of current window without changing layout) ( you can even show both toolbar and main menu in that case because it is only shown than the user wants it and is immidetly hidden and not cluttering screen space after. Because sometimes it is useful to access menu from other windows) ( and you can add both main menu and main toolbar in main editor window, imagine how much space it will save… It will also be a consistent behaviour )
Example how it is done in Rider.
It would be awesome if such option will be in unity .