I was watching someone play my demo and for some reason the dropdown did not load the resolution options. but that’s a bug i could not replicate with my setup.
I tried on my desktop and a old notebook i have. Even a couple of friends of mine did not have that problem.
And the code to load the options is not really any special.
this code is called on Start method
private void loadResolution()
{
resolutions = Screen.resolutions;
var temp = new List<Resolution>(resolutions);
temp.Sort((a, b) => a.width < b.width ? 1 : -1);
resolutions = temp.ToArray();
resolutionDropdown.ClearOptions();
List<string> resOpt = new List<string>();
var currIndex = 0;
for (var i = 0; i < resolutions.Length; i++)
{
var r = resolutions[i];
if (r.height == Screen.height && r.width == Screen.width)
{
currIndex = i;
}
resOpt.Add(r.width + "x" + r.height + " " + r.refreshRateRatio);
}
resolutionDropdown.AddOptions(resOpt);
resolutionDropdown.value = currIndex;
}