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
---
Utility/DeviceUtility.cs | 36 +++++++++++++++++++++++-------------
1 files changed, 23 insertions(+), 13 deletions(-)
diff --git a/Utility/DeviceUtility.cs b/Utility/DeviceUtility.cs
index 1b759a6..b1822c9 100644
--- a/Utility/DeviceUtility.cs
+++ b/Utility/DeviceUtility.cs
@@ -145,22 +145,32 @@
public static void GetCpuAndMemory(out int _cpu, out int _memory)//鍐呭瓨鍗曚綅鏄疢B
{
- _cpu = Environment.ProcessorCount;
- switch (Application.platform)
+ try
{
- case RuntimePlatform.Android:
- _memory = SDKUtility.Instance.Device.totalMemory;
- break;
- case RuntimePlatform.IPhonePlayer:
- _memory = IsLowMemory() ? 1 : 2 * 1024;
- break;
- default:
- _memory = 4 * 1024;
- break;
+ _cpu = Environment.ProcessorCount;
+ switch (Application.platform)
+ {
+ case RuntimePlatform.Android:
+ _memory = SDKUtility.Instance.Device.totalMemory;
+ break;
+ case RuntimePlatform.IPhonePlayer:
+ _memory = IsLowMemory() ? 1 : 2 * 1024;
+ break;
+ default:
+ _memory = 4 * 1024;
+ break;
+ }
+
+ cpu = _cpu;
+ memory = _memory;
+ }
+ catch (Exception ex)
+ {
+ Debug.Log(ex);
+ _cpu = 2;
+ _memory = 2 * 1024;
}
- cpu = _cpu;
- memory = _memory;
}
}
--
Gitblit v1.8.0