From 6ce4ae16561fd205c8bb3f530d5a20033f207f4f Mon Sep 17 00:00:00 2001
From: client_Hale <339726288@qq.com>
Date: 星期五, 24 八月 2018 18:19:12 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master' into Skill_Polymorph_BeatBackPlayer

---
 System/SystemSetting/SystemSetting.cs |   31 +++++++++++++++++++++++++++----
 1 files changed, 27 insertions(+), 4 deletions(-)

diff --git a/System/SystemSetting/SystemSetting.cs b/System/SystemSetting/SystemSetting.cs
index e2636d5..6aed415 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 GAMEFRAME_KEY = "GameFrameSetting";//鍨傜洿鍚屾鐜�
 
     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 gameFrameChangeEvent;
 
     public SystemSetting()
     {
@@ -50,6 +52,21 @@
     public float GetSoundEffect()
     {
         return LocalSave.GetFloat(SOUND_EFFECT_KEY, 1);
+    }
+
+    public void SetGameFrame(GameFrame _frame)
+    {
+        LocalSave.SetInt(GAMEFRAME_KEY, (int)_frame);
+        SetFPSLimit((int)_frame);
+        if (gameFrameChangeEvent != null)
+        {
+            gameFrameChangeEvent();
+        }
+    }
+
+    public GameFrame GetGameFrame()
+    {
+        return (GameFrame)LocalSave.GetInt(GAMEFRAME_KEY, (int)GameFrame.HalfFrame);
     }
 
     public void SetSystemSettingSwitch(SystemSwitch type, bool _value)
@@ -122,8 +139,7 @@
     public void SetQualityLevel(GameQuality _quality, bool _disabeCamera = true)
     {
         LocalSave.SetInt(QUALITY_LEVEL_KEY, Mathf.Clamp((int)_quality, 0, 2));
-        QualitySettings.SetQualityLevel((int)GameQuality.High);
-
+        QualitySettings.SetQualityLevel(Mathf.Clamp((int)_quality, 0, 2));
         switch (_quality)
         {
             case GameQuality.Low:
@@ -203,12 +219,12 @@
 
     public void SetFPSLimit(int _fps)
     {
-        LocalSave.SetInt(FPS_KEY, Application.targetFrameRate = Mathf.Clamp(_fps, 30, 60));
+        Application.targetFrameRate = Mathf.Clamp(_fps, 30, 60);
     }
 
     public int GetFPSLimit()
     {
-        return LocalSave.GetInt(FPS_KEY, 30);
+        return (int)GetGameFrame();
     }
 
     public void LetFPSUnLimit()
@@ -248,4 +264,11 @@
     Low = 0,
     Medium = 1,
     High = 2,
+}
+
+public enum GameFrame
+{
+    Free = -1,
+    HalfFrame = 30,
+    FullFrame = 60,
 }
\ No newline at end of file

--
Gitblit v1.8.0