Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Display Resolution Dialog: The 2019.3 replacement for those who can't live without it! :)

Discussion in 'Windows' started by SteffenItterheim, May 23, 2020.

  1. SteffenItterheim

    SteffenItterheim

    Joined:
    Apr 10, 2014
    Posts:
    96
    SHOCK! Unity deprecated and rather quickly removed the resolution dialog without a proper replacement! :eek:

    Then they gave us a C/C++ Screen Selector project that's really ugly to get working (particularly if you don't have a C/C++ Windows SDK background) and is nowhere near as convenient to use. For instance, default resolution is always 640x480. And how do I make it to run my Unity app after clicking Play? :mad:

    "Based on user data and customer research" ... well, I have a hunch in this case it's nowhere as obvious as, say, the removal of .. what was it called? That scripting language that no one even remembers existed 5 years ago when it was still part of Unity. Ah .. yes, Boo! So no, some of us do need the resolution dialog! Dearly so. :(

    I understand, if it's in the way of something new and great, by all means remove it and (gradually) replace it with something better, less buggier. But user data and customer research? Come on. We're the 10% you ignored who make non-public apps or just like to tinker with settings and generally dislike sending usage data to Unity! :p

    Enough ranting ... the good thing about this is, it's something we can simply fix this and bring it back - and making it even better! :cool:

    So without further ado here's the replacement I've come up with:

    Screenshot from the editor. Actual data will differ. 16k? We're not quite there yet. ;)


    What's cool about this?
    • FREE! Released under MIT License.
    • When used as the first (launch) scene it will automatically load the second scene in the Build Settings list when pressing Play.
    • Can also act as a popup in any scene. Press ESC (configurable) to bring it up. The Play/Quit buttons will be replaced with a "Close" button.
    • Has absolutely no dependencies to whatever. Not even TMPro. Just plain Unity 2019.3.
    • More features than the old Unity Resolution Dialog:
      • Changes are applied instantly!
      • Select refresh rate (exclusive fullscreen only - windowed modes use the desktop refresh rate)
      • Adjust Vsync Count: off, vsync on, vsync every 2nd, 3rd or 4th frame (useful as framerate limiter)
      • Built-in FPS display so you can see the difference in fps when changing settings
    Caveats:
    • No option to display dialog only when Shift or Alt are held down (see comment #4)
    • Switching Displays requires restarting the app. Due to lack of a 2nd monitor I have only been able to test this once.
    • Tested only on Windows but should work on Mac OS X and Linux. Probably useless on any other platform except changing quality levels.
    • In editor anything but Quality Level is locked because all other settings are controlled by the editor respectively not available in windowed mode.
    • No input support. That's the one aspect of the original dialog I've never had any use for.
    Feel free to leave feedback or better yet: fix anything that ain't working and send a pull request.
     
    Last edited: May 24, 2020
    Antan, devotid, MattDavis and 19 others like this.
  2. Shizola

    Shizola

    Joined:
    Jun 29, 2014
    Posts:
    245
    Legend
     
  3. Twyker_gp

    Twyker_gp

    Joined:
    Dec 4, 2018
    Posts:
    26
    Does it also work like the old original one, where you could start it with Shift+Click only?
     
  4. SteffenItterheim

    SteffenItterheim

    Joined:
    Apr 10, 2014
    Posts:
    96
    Unfortunately not. It would have been a rather odd behaviour therefore I opted not to try and mimic this behaviour.

    The reason is: GetKey() only works in Update(), and apparently while a scene is loading or in the first scene, the first time keys are registered/received happens at the earliest in the 3rd time Update() gets called. So you would see the dialog anyway for 3 frames even if not holding down Shift or Alt.

    Perhaps someone knows a trick or workaround to this? I can only think of hiding the dialog for the first few frames so it wouldn't feel as odd, but you'd still have to keep the Shift/Alt key pressed for sometime longer compared to the original dialog due to Unity having to initialize first.
     
    AL_W likes this.
  5. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    2,759
    Thanks for making this!!
     
  6. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,230
    It's super-cool that you have created and shared this! Unfortunately, for the use case of VR games, the shift/alt-feature was all I (and quite a few players) ever needed that resolution dialog for.

    It really sucks that Unity removed it.
     
    Twyker_gp and Lars-Steenhoff like this.
  7. dre788

    dre788

    Joined:
    Feb 15, 2013
    Posts:
    49
    The unity package link seems to be broken.
     
unityunity