少年修仙传客户端代码仓库
1772 手机运行游戏时过热 针对某些特别高分辨率的屏幕,比如2k屏,4k屏,默认运行帧率降低为30帧。
3个文件已修改
67 ■■■■■ 已修改文件
Core/GameEngine/Login/Launch.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/SystemSetting/SystemSetWin.cs 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/SystemSetting/SystemSetting.cs 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/Login/Launch.cs
@@ -45,7 +45,7 @@
        SoundPlayer.CreateSoundPlayer();
        SoundPlayer.Instance.PlayLoginMusic();
        SystemSetting.Instance.SetSoundVolume(SystemSetting.Instance.GetSoundVolume());
        SystemSetting.Instance.SetGameFrame(SystemSetting.Instance.GetGameFrame());
        SystemSetting.Instance.SetGameFps(SystemSetting.Instance.GetGameFps());
        SDKUtility.Instance.Init();
        GameObjectPoolManager.Instance.gameObject.name = "GameObjectPool";
System/SystemSetting/SystemSetWin.cs
@@ -82,7 +82,7 @@
            UpdateToggleSkin(m_OtherPlayer);
            UpdateToggleSkin(m_Monster);
            m_SixtyFrame.isOn = SystemSetting.Instance.GetGameFrame() == GameFrame.FullFrame;
            m_SixtyFrame.isOn = SystemSetting.Instance.GetGameFps() == GameFps.Full;
            var serverName = ServerListCenter.Instance.GetServerData(ServerListCenter.Instance.currentServer.region_flag).name;
            var playerAccount = PlayerDatas.Instance.baseData.AccID.Split('@');
@@ -182,7 +182,7 @@
                SystemSetting.Instance.SetQualityLevel(GameQuality.Low);
                if (isInited)
                {
                    SystemSetting.Instance.SetGameFrame(GameFrame.HalfFrame);
                    SystemSetting.Instance.SetGameFps(GameFps.Half);
                    SystemSetting.Instance.SetPlayerSyncCount(5);
                }
            }
@@ -192,21 +192,21 @@
        private void SwitchGameFrame()
        {
            var gameFrame = SystemSetting.Instance.GetGameFrame();
            var gameFrame = SystemSetting.Instance.GetGameFps();
            if (gameFrame==GameFrame.HalfFrame)
            if (gameFrame == GameFps.Half)
            {
                SystemSetting.Instance.SetGameFrame(GameFrame.FullFrame);
                SystemSetting.Instance.SetGameFps(GameFps.Full);
            }
            else
            {
                SystemSetting.Instance.SetGameFrame(GameFrame.HalfFrame);
                SystemSetting.Instance.SetGameFps(GameFps.Half);
            }
        }
        private void OnSwitchGameFrame()
        {
            m_SixtyFrame.isOn = SystemSetting.Instance.GetGameFrame() == GameFrame.FullFrame;
            m_SixtyFrame.isOn = SystemSetting.Instance.GetGameFps() == GameFps.Full;
        }
        private void OnShowOrHideOtherPlayers(bool _value)
System/SystemSetting/SystemSetting.cs
@@ -11,7 +11,6 @@
    const string QUALITY_LEVEL_KEY = "GameQualityLevel";
    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>();
@@ -54,7 +53,7 @@
        return LocalSave.GetFloat(SOUND_EFFECT_KEY, 1);
    }
    public void SetGameFrame(GameFrame _frame)
    public void SetGameFps(GameFps _frame)
    {
        LocalSave.SetInt(GAMEFRAME_KEY, (int)_frame);
        SetFPSLimit((int)_frame);
@@ -64,9 +63,9 @@
        }
    }
    public GameFrame GetGameFrame()
    public GameFps GetGameFps()
    {
        return (GameFrame)LocalSave.GetInt(GAMEFRAME_KEY, (int)GameFrame.FullFrame);
        return (GameFps)LocalSave.GetInt(GAMEFRAME_KEY, (int)GameFps.Full);
    }
    public void SetSystemSettingSwitch(SystemSwitch type, bool _value)
@@ -191,18 +190,18 @@
            {
                var defaultQuality = GameQuality.High;
//                 if (DeviceUtility.cpu >= 4 && DeviceUtility.memory > 3.5f * 1024)
//                 {
//                     defaultQuality = GameQuality.High;
//                 }
//                 else if (DeviceUtility.cpu >= 4 && DeviceUtility.memory > 2.5f * 1024)
//                 {
//                     defaultQuality = GameQuality.Medium; ;
//                 }
//                 else if (DeviceUtility.cpu > 1 && DeviceUtility.memory > 1.5f * 1024)
//                 {
//                     defaultQuality = GameQuality.Low;
//                 }
                //                 if (DeviceUtility.cpu >= 4 && DeviceUtility.memory > 3.5f * 1024)
                //                 {
                //                     defaultQuality = GameQuality.High;
                //                 }
                //                 else if (DeviceUtility.cpu >= 4 && DeviceUtility.memory > 2.5f * 1024)
                //                 {
                //                     defaultQuality = GameQuality.Medium; ;
                //                 }
                //                 else if (DeviceUtility.cpu > 1 && DeviceUtility.memory > 1.5f * 1024)
                //                 {
                //                     defaultQuality = GameQuality.Low;
                //                 }
                return (GameQuality)LocalSave.GetInt(QUALITY_LEVEL_KEY, (int)defaultQuality);
            }
@@ -224,7 +223,7 @@
    public int GetFPSLimit()
    {
        return (int)GetGameFrame();
        return (int)GetGameFps();
    }
    public void LetFPSUnLimit()
@@ -236,6 +235,18 @@
    {
        systemSettings.Clear();
        m_PlayerSyncCount = -1;
    }
    private GameFps GetRecommendFps()
    {
        if (Screen.width * Screen.height > (1920 * 1080 + 10000))
        {
            return GameFps.Half;
        }
        else
        {
            return GameFps.Full;
        }
    }
    IEnumerator Co_WaitFewMinute()
@@ -266,9 +277,9 @@
    High = 2,
}
public enum GameFrame
public enum GameFps
{
    Free = -1,
    HalfFrame = 30,
    FullFrame = 60,
    Half = 30,
    Full = 60,
}