diff options
| author | chai <215380520@qq.com> | 2023-11-02 11:51:31 +0800 |
|---|---|---|
| committer | chai <215380520@qq.com> | 2023-11-02 11:51:31 +0800 |
| commit | 7f493f682503f5186308de7b8f74b5b49233cfe4 (patch) | |
| tree | 8a91e2056bc79788ee4735dce88b8d516ba12beb /GameCode/SettingsShadowResolution.cs | |
+init
Diffstat (limited to 'GameCode/SettingsShadowResolution.cs')
| -rw-r--r-- | GameCode/SettingsShadowResolution.cs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/GameCode/SettingsShadowResolution.cs b/GameCode/SettingsShadowResolution.cs new file mode 100644 index 0000000..d8bb6cb --- /dev/null +++ b/GameCode/SettingsShadowResolution.cs @@ -0,0 +1,26 @@ +using UnityEngine; + +public class SettingsShadowResolution : MonoBehaviour +{ + public EnumSelector selector; + + private void Start() + { + selector.onChange.AddListener(OnChange); + } + + private void OnEnable() + { + selector.options.Clear(); + selector.options.AddRange(new string[5] { "256", "512", "1024", "2048", "4096" }); + if ((bool)SettingsManager.Instance) + { + selector.SetIndex(SettingsManager.AALevelToInt(SettingsManager.Instance.AntiAliasing)); + } + } + + private void OnChange() + { + SettingsManager.Instance.SetAntiAliasing(SettingsManager.IntToAALevel(selector.Index)); + } +} |
