Last active
March 1, 2021 00:16
-
-
Save sweatyc/192578bbf54a606d95ed50c2101fedee to your computer and use it in GitHub Desktop.
A master manager that contols in-game settings.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
namespace SweatyChair | |
{ | |
public static class SettingManager | |
{ | |
/// <summary> | |
/// Sets the resolution to the specific values, call this on Awake. | |
/// </summary> | |
public static void SetResolution() | |
{ | |
if (SettingSettings.current.manualScreenWidth > 0) | |
Screen.SetResolution(SettingSettings.current.manualScreenWidth, Mathf.RoundToInt(1f * SettingSettings.current.manualScreenWidth * Screen.currentResolution.height / Screen.currentResolution.width), Screen.fullScreen); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment