So, I set a list of resolutions in the Game view, which I believed to be a list of available resolutions for the game.
And then wanted to see if it actually worked. So I created this code:
using UnityEngine;
using System.Collections;
public class ListResolutions : MonoBehaviour {
void Start () {
Resolution[] resolutions = Screen.resolutions;
foreach (Resolution res in resolutions) {
Debug.Log(res.width + "x" + res.height);
}
}
}
And attached it to a new GameObject. When I click Play, it prints out “640x480”. As you can see, that is not in fact a resolution supported on that list. After doing a bit of research, I found that it prints out a list of the resolutions supported by your computer. I looked at my resolution options, just to be sure. As you could expect, 640x480 is not in fact a resolution supported by my computer:
Any clue at all what’s going on here? I’m just trying to get a resolution option into my game without using the stupid ugly Unity launcher, and if the settings in the Game view are not how you add resolution options, please enlighten me regarding that. Thanks in advance!