Screen Resolution Limited in Editor?

Im doing a screen resolution switcher which is fairly simple using the Screen.SetResolution. For this i create a gui of possible options using Screen.resolutions array. Simple.

I noticed however that the Editor seem to override this array to only contain one resolution namely 640x480. Correct me if im wrong please.

My thesis for this behavior is that cause the editor do not need to be rendered in the actual resolution as it is for testing, but why am i not allowed to see all supported resolutions in the editor as stated in the API? In my opinion such limitation should happen in the Screen.SetResolution if you dont want people running other resolutions in the editor and not by removing the option to see it as supported.

Makes it a little harder to create the gui if you have to build each time to check allignment.

Is there a way to get all supported resolution while in the editor?

Not sure, but a simple workaround would be to have the script check to see if you’re running in the editor (using Application.platform) and use a pre-defined array of resolutions in that case.

–Eric

  • BUMP *

Just came across this issue myself.

So is this done on purpose for some reason, or is it a bug ?

DGuy

I didnt find any so i went with erics idea of using a predefined array while in the editor.