Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

[released] Fullscreen Editor

Discussion in 'Assets and Asset Store' started by MukaSchultze, Apr 14, 2019.

  1. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,669
    Just for fun, I downloaded Unity 2023.1.4f1 and installed HDRP 15.0.8 to play with the new water samples. Fullscreen Editor spams these errors:
    Cannot initialize non-default texture with negative or zero width.
    UnityEngine.Texture2D:.ctor (int,int,UnityEngine.TextureFormat,bool,bool)
    FullscreenEditor.FullscreenUtility:LoadTexture (string) (at Assets/Fullscreen/Editor/FullscreenUtility.cs:216)
    FullscreenEditor.FullscreenUtility:FindOrLoadTexture (string) (at Assets/Fullscreen/Editor/FullscreenUtility.cs:209)
    FullscreenEditor.FullscreenUtility/Icon:get_Texture () (at Assets/Fullscreen/Editor/FullscreenUtility.cs:68)
    FullscreenEditor.FullscreenUtility/Icon:eek:p_Implicit (FullscreenEditor.FullscreenUtility/Icon) (at Assets/Fullscreen/Editor/FullscreenUtility.cs:80)
    FullscreenEditor.PlaceholderWindow:OnGUI () (at Assets/Fullscreen/Editor/PlaceholderWindow.cs:102)
    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)

    and

    Fullscreen Editor: Failed to load texture: UnityEngine.UnityException: Failed to create texture because of invalid parameters.
    at UnityEngine.Texture2D.Internal_Create (UnityEngine.Texture2D mono, System.Int32 w, System.Int32 h, System.Int32 mipCount, UnityEngine.Experimental.Rendering.GraphicsFormat format, UnityEngine.TextureColorSpace colorSpace, UnityEngine.Experimental.Rendering.TextureCreationFlags flags, System.IntPtr nativeTex, System.String mipmapLimitGroupName) [0x00025] in <219b2b20ab40401eb30e8c96555bfa53>:0
    at UnityEngine.Texture2D..ctor (System.Int32 width, System.Int32 height, UnityEngine.TextureFormat textureFormat, System.Int32 mipCount, System.Boolean linear, System.IntPtr nativeTex, System.Boolean createUninitialized, System.Boolean ignoreMipmapLimit, System.String mipmapLimitGroupName) [0x0006d] in <219b2b20ab40401eb30e8c96555bfa53>:0
    at UnityEngine.Texture2D..ctor (System.Int32 width, System.Int32 height, UnityEngine.TextureFormat textureFormat, System.Boolean mipChain, System.Boolean linear) [0x00000] in <219b2b20ab40401eb30e8c96555bfa53>:0
    at FullscreenEditor.FullscreenUtility.LoadTexture (System.String base64) [0x00000] in C:\Users\kdgal\OneDrive\Desktop\kelly 4\UnityGames\HDRPtest\Assets\Fullscreen\Editor\FullscreenUtility.cs:216
    UnityEngine.Debug:LogErrorFormat (string,object[])
    FullscreenEditor.Logger:Error (string,object[]) (at Assets/Fullscreen/Editor/Logger.cs:40)
    FullscreenEditor.FullscreenUtility:LoadTexture (string) (at Assets/Fullscreen/Editor/FullscreenUtility.cs:225)
    FullscreenEditor.FullscreenUtility:FindOrLoadTexture (string) (at Assets/Fullscreen/Editor/FullscreenUtility.cs:209)
    FullscreenEditor.FullscreenUtility/Icon:get_Texture () (at Assets/Fullscreen/Editor/FullscreenUtility.cs:68)
    FullscreenEditor.FullscreenUtility/Icon:eek:p_Implicit (FullscreenEditor.FullscreenUtility/Icon) (at Assets/Fullscreen/Editor/FullscreenUtility.cs:80)
    FullscreenEditor.PlaceholderWindow:OnGUI () (at Assets/Fullscreen/Editor/PlaceholderWindow.cs:102)
    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)

    Despite the errors, it still seems to function correctly, so it's only a bit annoying.
     
  2. MadStuntman

    MadStuntman

    Joined:
    Jun 27, 2019
    Posts:
    25
    The answer is already in the error message: Cannot initialize non-default texture with negative or zero width.
    Just click on error and change in the code default size of new texture from 0, 0 tо 4, 4.
     
    kdgalla likes this.
  3. clownhunter

    clownhunter

    Joined:
    May 26, 2013
    Posts:
    61
    2021.3.17f1 I'm having an issue where I can make the game view go fullscreen with the hotkey, but can't get out of it while the game is playing. I have to call Application.Quit() from the code, then I can exit fullscreen with the hotkey. Is this expected behavior?
     
    Lars-Steenhoff likes this.
  4. Malcolm-Robinson

    Malcolm-Robinson

    Joined:
    Nov 7, 2015
    Posts:
    2
    To anyone experiencing a bug in Fullscreen Editor with 2022 LTS that prevents F10 and the other shortcut keys from working in play mode, or locks you into fullscreen mode which prevents you from exiting play mode, I took the whole afternoon to try to solve it (I simply can't go back to non-fullscreen) and I have a fix.

    First, a description of the behavior I was experiencing:

    1. F10, F11 etc. work perfectly, but in play mode, they don't work when the Game view is in focus.
    2. If you go to the Scene view in play mode and then hit F10, it will go fullscreen as expected, but now the application will be soft-locked unless you have a shortcut key set up to exit play mode.
    3. After entering play mode, even though F10 doesn't work, directly going to the menu item "Fullscreen/Game View" works, but it soft-locks the application as described above.
    4. After occurring once, this behavior is suddenly shared by ALL projects on my system using 2022, even if they had been working perfectly with fullscreen editor for months.
    5. Projects using 2021 LTS are unaffected.

    This new behavior happened suddenly after months of working perfectly with this version of Unity, and years of working perfectly with previous versions. There was no apparent trigger; I hadn't installed any new version of the editor or modified any assets/packages in the project. There were only three notable things I had done recently:

    1. Same day: I downloaded the "3D URP Core" template.
    2. Same day: I imported the "Crest Ocean System URP" asset into a fresh project to test it.
    3a. Just before: In my main project, I used Amplify Shader Editor to edit a shader.
    3b. Just before: I switched scenes and entered play mode.


    Now here's how I was able to fix it. I assumed that since the behavior is shared between projects, even previously working projects that I hadn't touched, it must be an EditorPrefs issue, not a project-specific issue.

    I opened the Registry Editor (I'm using Windows 10) and went here:
    HKEY_CURRENT_USER\SOFTWARE\Unity Technologies\Unity Editor 5.x

    This is where all the EditorPrefs keys are stored. They're mostly just stored positions and dimensions of editor windows, but there's other stuff there like asset specific settings and even your Unity Hub projects list. While simply deleting all the keys might solve the issue, I didn't want to risk breaking something else, so I went though each key in the list and deleted groups of things that I thought might be the cause. Deleting all the "Fullscreen.*" keys and the "UnityEditor.*" keys did nothing.

    However, after deleting a key named something like GPUDeviceName (the exact name and capitalization may have been different), everything went back to normal. This key was probably the culprit, but it might have actually been another key alphabetically close to GPUDeviceName which I deleted in the same batch. It could have even been a combination of keys that I deleted. Who knows...

    I hope this helps someone else who's having the same problem.

    TL;DR
    If F10 doesn't work in play mode, open the Windows Registry Editor, go to "HKEY_CURRENT_USER\SOFTWARE\Unity Technologies\Unity Editor 5.x" and delete the key called "GPUDeviceName" (or something similar).
     
  5. vertexx

    vertexx

    Joined:
    Mar 18, 2014
    Posts:
    379
    Let's hope the Dev sees this and makes the fix less dangerous!
    Thanks.
     
  6. Absinthe23

    Absinthe23

    Joined:
    Feb 1, 2015
    Posts:
    16
    System.Reflection.TargetInvocationException whenever there is a state change (open Project, exit play mode etc).

    No reply from the dev on this bug after a few weeks of emails and the contact form on thier website seems broken.

    I'll try to find a fix. Meanwhile did anyone else solve it?
     
  7. Absinthe23

    Absinthe23

    Joined:
    Feb 1, 2015
    Posts:
    16
    Fix is simple: just completely delete the fullscreen folder in your project and re-install.
     
  8. MukaSchultze

    MukaSchultze

    Joined:
    Feb 12, 2014
    Posts:
    256
    Took me a while to figure this out, I even had to dig up Unity's source code to understand what was going on, but it seems to be a new Unity feature instead of a bug.

    There's this button on the game view (highlighted below) that disables shortcuts while the game is playing. This setting is shared with every project, that's why cleaning the registry "fixed" it, because it reverted to the default state.

    To add to the confusion, the tooltip only says "Unity shortcuts" instead of explaining what the toggle actually does.

    upload_2023-9-7_19-21-42.png
     
  9. Malcolm-Robinson

    Malcolm-Robinson

    Joined:
    Nov 7, 2015
    Posts:
    2
    Thanks so much for the explanation! It makes sense now. I guess the relevant key I deleted was "GameView.IgnoreWhenPlayModeFocused" (which changes its value when I toggle the button) and not "GPUDeviceName". I had no idea that button even existed and I'll be extra careful with it from now on. Apologies for implying that this was a bug in Fullscreen Editor.
     
  10. gekidoslair

    gekidoslair

    Joined:
    Sep 7, 2012
    Posts:
    128
    have this in a project, 22.3.7f and it's throwing exceptions when I enter play mode (not full screen):
    not sure what's up

    NullReferenceException: Object reference not set to an instance of an object
    FullscreenEditor.ReflectionUtility.GetPropertyValue[T] (System.Object obj, System.String propertyName) (at Assets/Third Party/Fullscreen/Editor/ReflectionUtility.cs:115)
    FullscreenEditor.ViewPyramid..ctor (UnityEngine.ScriptableObject viewOrWindow) (at Assets/Third Party/Fullscreen/Editor/ViewPyramid.cs:75)
    FullscreenEditor.Fullscreen.GetFullscreenFromView (UnityEngine.ScriptableObject viewOrWindow, System.Boolean rootView) (at Assets/Third Party/Fullscreen/Editor/Fullscreen.cs:66)
    System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <b89873cb176e44a995a4781c7487d410>:0)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <b89873cb176e44a995a4781c7487d410>:0)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <b89873cb176e44a995a4781c7487d410>:0)
    InfinityCode.UltimateEditorEnhancer.Integration.FullscreenEditor.GetFullscreenFromView (UnityEngine.ScriptableObject viewOrWindow, System.Boolean rootView) (at Assets/Plugins/Infinity Code/Ultimate Editor Enhancer/Scripts/Editor/Integration/FullscreenEditor.cs:47)
    InfinityCode.UltimateEditorEnhancer.Integration.FullscreenEditor.IsFullscreen (UnityEngine.ScriptableObject viewOrWindow) (at Assets/Plugins/Infinity Code/Ultimate Editor Enhancer/Scripts/Editor/Integration/FullscreenEditor.cs:52)
    System.Linq.Enumerable.TryGetFirst[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] predicate, System.Boolean& found) (at <f3cb625e9a3f437991ebaf58a99c81f7>:0)
    System.Linq.Enumerable.FirstOrDefault[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] predicate) (at <f3cb625e9a3f437991ebaf58a99c81f7>:0)
    InfinityCode.UltimateEditorEnhancer.Behaviors.Switcher.SceneViewToGameView () (at Assets/Plugins/Infinity Code/Ultimate Editor Enhancer/Scripts/Editor/Behaviours/Switcher.cs:121)
    UnityEditor.EditorApplication.Internal_CallDelayFunctions () (at <97436df440ca462884c5332c1d8ebbe7>:0)
     
  11. ethaneditsbusiness

    ethaneditsbusiness

    Joined:
    Feb 6, 2020
    Posts:
    31
    Does anyone know why the fullscreen button shows the toolbar? (F9 key) Ive pressed all the fullscreen buttons and they all do this. It didn't use to do this, I guess I did something and now it always show this bar which is really annoying because its not really fullscreen anymore.
     

    Attached Files:

  12. MukaSchultze

    MukaSchultze

    Joined:
    Feb 12, 2014
    Posts:
    256
    If you haven't changed the keybinds, F8 should hide/show the toolbar on all kinds of windows.