Skip to content

Instantly share code, notes, and snippets.

@sweatyc
Last active March 1, 2021 00:12
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/21109701f2b66f954c2138bc1f086daf to your computer and use it in GitHub Desktop.
Save sweatyc/21109701f2b66f954c2138bc1f086daf to your computer and use it in GitHub Desktop.
The setting scipts for Settings in game.
using UnityEngine;
namespace SweatyChair
{
[CreateAssetMenu(fileName = "SettingSettings", menuName = "Sweaty Chair/Setting Settings")]
public class SettingSettings : ScriptableObjectSingleton<SettingSettings>
{
[Tooltip("Manual screen width in Windows, 0 to disable, used for standalone only")]
public int manualScreenWidthWin;
[Tooltip("Manual screen width in macOS, 0 to disable, used for standalone only")]
public int manualScreenWidthOsx = 1920;
public int manualScreenWidth {
get {
#if UNITY_STANDALONE_WIN
return manualScreenWidthWin;
#elif UNITY_STANDALONE_OSX
return manualScreenWidthOsx;
#else
return 0;
#endif
}
}
#if UNITY_EDITOR
[UnityEditor.MenuItem("Sweaty Chair/Setting Settings")]
private static void OpenSettingSettings()
{
current.OpenAssetsFile();
}
#endif
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment