Reputation: 192
I want to do this because my game doesn't work on all of the resolutions that unity gives the user access to. For example, on this picture I would want to remove the currently selected resolution so it can't get accessed.
I have already tried searching google but I only came up with how to remove the startup screen entirely. I don't want this; I still want the user to be able to select resolutions on startup but want to remove specific resolutions from the dropdown.
Upvotes: 2
Views: 8422
Reputation: 125245
It's called the Resolution Dialog and below is an instruction on how to disable that.
1.Go to File ---> Build Settings....
2.Select your platform (PC, Mac & Linux Standalone)
3.Click Player Settings... then Click on Resolution and Presentation
4.On the Display Resolution Dialog, change that to Disabled .
Can be done from script like below: (Editor only)
PlayerSettings.displayResolutionDialog = ResolutionDialogSetting.Disabled;
is it possible i can dissable only a few of the resolutions options from the startup menu?
No. There is no known way to add/remove whatever resolution Resolution Dialog
displays.
The solution is to make your own Resolution Dialog with Unity's UI and Dropdown menu and program it to whatever resolution you want. You can then use Screen.SetResolution
to change the resolution to the selected one from your own custom Resolution Dialog.
For example:
Screen.SetResolution(selectedWidth, selectedHeight, true);
Upvotes: 4