From fd42cfd11d6205a75fa7c8bf16e6284d54aaf3a3 Mon Sep 17 00:00:00 2001
From: client_Hale <339726288@qq.com>
Date: 星期五, 24 八月 2018 16:41:00 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
---
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