From 8950f16553279b41cd264e087ccced593f548815 Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期六, 11 八月 2018 14:00:18 +0800
Subject: [PATCH] 2391 【前端】游戏性能优化
---
System/SystemSetting/SystemSetting.cs | 24 +++++++++++++++++++++++-
1 files changed, 23 insertions(+), 1 deletions(-)
diff --git a/System/SystemSetting/SystemSetting.cs b/System/SystemSetting/SystemSetting.cs
index c4d0174..16e85cb 100644
--- a/System/SystemSetting/SystemSetting.cs
+++ b/System/SystemSetting/SystemSetting.cs
@@ -162,7 +162,29 @@
//鐩墠鐪嬭捣鏉ユ墍鏈夌殑瀹夊崜鏈鸿窇楂樻晥鏋滈兘鍙互鎺ュ彈锛屽厛缁欑帺瀹堕粯璁よ缃珮鏁堟灉銆�
if (Application.platform == RuntimePlatform.Android)
{
- return (GameQuality)LocalSave.GetInt(QUALITY_LEVEL_KEY, (int)GameQuality.High);
+ if (!LocalSave.HasKey(QUALITY_LEVEL_KEY))
+ {
+ 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;
+ }
+
+ return (GameQuality)LocalSave.GetInt(QUALITY_LEVEL_KEY, (int)defaultQuality);
+ }
+ else
+ {
+ return (GameQuality)LocalSave.GetInt(QUALITY_LEVEL_KEY);
+ }
}
else
{
--
Gitblit v1.8.0