Skip to content

Instantly share code, notes, and snippets.

@sweatyc
Last active March 1, 2021 00:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sweatyc/192578bbf54a606d95ed50c2101fedee to your computer and use it in GitHub Desktop.
Save sweatyc/192578bbf54a606d95ed50c2101fedee to your computer and use it in GitHub Desktop.
A master manager that contols in-game settings.
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