So in my game options, there is a resolution dropdown, and Unity adds a bunch of the same resolution with different refresh rates: [151523-df.png*_|151523]
(which don’t work anyway: you can choose any refresh rate and it will stay the same as the current refresh rate your monitor is set to, maybe because of vsync settings?.)
I wanted to remove or hide some of the options, keeping only 60Hz, 120Hz and 144Hz, for that I tried this:
resDropdown.options.RemoveAll(c => c.text.Contains("23Hz") || c.text.Contains("24Hz") || c.text.Contains("50Hz") || c.text.Contains("59Hz") || c.text.Contains("99Hz"));
However it seems that it only reduces the array of resolutions length, so in fact, when the dropdown displays 640x480 60Hz, the assigned resolution is 640x480 23Hz, which is the first in the array, or list in that case.
Or as there is only 3 different refresh rates for each resolution, the 4th one should be 800x600 60Hz, but the assigned resolution is 640x480 59Hz, which is the fourth in the list.
Full dropdown code:
resolutions = Screen.resolutions;
resDropdown.ClearOptions();
List<string> options = new List<string>();
int currentResIndex = 0;
for (int i = 0; i < resolutions.Length; i++)
{
string option = resolutions<em>.width + " x " + resolutions_.height + " " + resolutions*.refreshRate +"Hz";*_</em>
options.Add(option);
if (resolutions.width == Screen.currentResolution.width && resolutions_.height == Screen.currentResolution.height && resolutions*.refreshRate == Screen.currentResolution.refreshRate)
{
currentResIndex = i;
}
}*_
resDropdown.AddOptions(options);
resDropdown.options.RemoveAll(c => c.text.Contains(“23Hz”) || c.text.Contains(“24Hz”) || c.text.Contains(“50Hz”) || c.text.Contains(“59Hz”) || c.text.Contains(“99Hz”));
_*