- Home /
Question by
oscar70701 · May 01, 2020 at 01:39 PM ·
resolution settings
why the screen frame rate is not changing
ScreenResolions = Screen.resolutions;
resolutionDropdown.ClearOptions();
List<string> options = new List<string>();
int currentResolutionIndex = 0;
for (int i = 0; i < ScreenResolions.Length; i++)
{
string option = ScreenResolions[i].width + " x " + ScreenResolions[i].height + " " + ScreenResolions[i].refreshRate + "Hz";
options.Add(option);
if (ScreenResolions[i].width == Screen.currentResolution.width & ScreenResolions[i].height == Screen.currentResolution.height & ScreenResolions[i].refreshRate == Screen.currentResolution.refreshRate)
{
currentResolutionIndex = i;
}
}
public void SetResolution(int resolutionIndex)
{
Resolution resoluion = ScreenResolions[resolutionIndex];
Screen.SetResolution(resoluion.width, resoluion.height, Screen.fullScreen, resoluion.refreshRate);
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612233004im_/https://answers.unity.com/themes/thub/images/avi.jpg)