So i wrote this code to allow the player to change resolutions. My question is, are the options, that will be displayed in the dropdown, going to be different for each computer? On my laptop the highest resolution option is 1366x768, so if a player uses a better PC to play the game, does he get the option for a better resolution? Here’s the code:
public Dropdown resolutionDropdown;
Resolution resolutions;
void Start()
{
resolutions = Screen.resolutions;
resolutionDropdown.ClearOptions();
int currentResolution = 0;
List<string> dropdownOptions = new List<string>();
for (int i = 0; i < resolutions.Length; i++)
{
string option = resolutions_.width + "x" + resolutions*.height;*_
dropdownOptions.Add(option);
if(resolutions_.width == Screen.width && resolutions*.height == Screen.height)
{
currentResolution = i;
}
}
resolutionDropdown.AddOptions(dropdownOptions);
resolutionDropdown.value = currentResolution;
resolutionDropdown.RefreshShownValue();
}*_
public void SetResolution(int resolutionIndex)
{
Resolution resolution = resolutions[resolutionIndex];
Screen.SetResolution(resolution.width, resolution.height, Screen.fullScreen);
}