From e925aced4b439a2583a86d2924d070373b4a89d3 Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期四, 23 八月 2018 15:52:18 +0800
Subject: [PATCH] 2824 1.0.15【前端】系统设置的标签页新增最大帧数选项

---
 System/SystemSetting/SystemSetting.cs |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/System/SystemSetting/SystemSetting.cs b/System/SystemSetting/SystemSetting.cs
index e2636d5..f50eaba 100644
--- a/System/SystemSetting/SystemSetting.cs
+++ b/System/SystemSetting/SystemSetting.cs
@@ -12,6 +12,7 @@
     const string SOUND_VOLUME_KEY = "SoundRatioKey";  //闊充箰
     const string SOUND_EFFECT_KEY = "SoundEffect"; //闊虫晥
     const string FPS_KEY = "FPSKey";
+    const string VSYNC_KEY = "GameVSyncCountSetting";//鍨傜洿鍚屾鐜�
 
     public Dictionary<SystemSwitch, bool> systemSettings = new Dictionary<SystemSwitch, bool>();
 
@@ -20,6 +21,7 @@
     public event Action<SystemSwitch, bool> OnSettingChanged;
     public event Action qualityLevelChangeEvent;
     public event Action playerSyncCountChangeEvent;
+    public event Action vSyncCountChangeEvent;
 
     public SystemSetting()
     {
@@ -50,6 +52,21 @@
     public float GetSoundEffect()
     {
         return LocalSave.GetFloat(SOUND_EFFECT_KEY, 1);
+    }
+
+    public void SetVSyncCount(int _vSync)
+    {
+        LocalSave.SetInt(VSYNC_KEY, QualitySettings.vSyncCount = Mathf.Clamp(_vSync, 0, 2));
+
+        if (vSyncCountChangeEvent != null)
+        {
+            vSyncCountChangeEvent();
+        }
+    }
+
+    public int GetVSyncCount()
+    {
+        return LocalSave.GetInt(VSYNC_KEY, 2);
     }
 
     public void SetSystemSettingSwitch(SystemSwitch type, bool _value)
@@ -122,7 +139,6 @@
     public void SetQualityLevel(GameQuality _quality, bool _disabeCamera = true)
     {
         LocalSave.SetInt(QUALITY_LEVEL_KEY, Mathf.Clamp((int)_quality, 0, 2));
-        QualitySettings.SetQualityLevel((int)GameQuality.High);
 
         switch (_quality)
         {
@@ -131,6 +147,7 @@
                 Shader.DisableKeyword("QUALITY_HGH");
                 Shader.DisableKeyword("QUALITY_MED");
                 Shader.EnableKeyword("QUALITY_LOW");
+                SetVSyncCount(2);
                 break;
             case GameQuality.Medium:
                 Shader.globalMaximumLOD = 250;

--
Gitblit v1.8.0