using System;
|
using System.Collections;
|
using System.Collections.Generic;
|
using System.IO;
|
using System.Security.Cryptography;
|
using System.Text;
|
|
using UnityEngine;
|
using System.Threading;
|
|
[XLua.LuaCallCSharp]
|
public class Config : Singleton<Config>
|
{
|
|
bool isPlaying = true;
|
|
bool m_Inited = false;
|
public bool inited {
|
get { return m_Inited; }
|
private set { m_Inited = value; }
|
}
|
|
public void SyncLoadConfigs()
|
{
|
}
|
|
int GetMinWorkingTaskCount()
|
{
|
switch (Application.platform)
|
{
|
case RuntimePlatform.Android:
|
if (DeviceUtility.cpu >= 4 && DeviceUtility.memory > 3.2f * 1024)
|
{
|
return 4;
|
}
|
else if (DeviceUtility.cpu >= 4 && DeviceUtility.memory > 2.5f * 1024)
|
{
|
return 2;
|
}
|
else
|
{
|
return 1;
|
}
|
case RuntimePlatform.IPhonePlayer:
|
if (DeviceUtility.cpu > 1 && DeviceUtility.memory > 1.5f * 1024)
|
{
|
return 4;
|
}
|
else
|
{
|
return 1;
|
}
|
case RuntimePlatform.WindowsEditor:
|
return 4;
|
default:
|
return 1;
|
}
|
}
|
|
int GetMaxWorkingTaskCount()
|
{
|
switch (Application.platform)
|
{
|
case RuntimePlatform.Android:
|
if (DeviceUtility.cpu >= 4 && DeviceUtility.memory > 3.2f * 1024)
|
{
|
return 20;
|
}
|
else if (DeviceUtility.cpu >= 4 && DeviceUtility.memory > 2.5f * 1024)
|
{
|
return 10;
|
}
|
else if (DeviceUtility.cpu > 1 && DeviceUtility.memory > 1.5f * 1024)
|
{
|
return 4;
|
}
|
else
|
{
|
return 1;
|
}
|
case RuntimePlatform.IPhonePlayer:
|
if (DeviceUtility.cpu > 1 && DeviceUtility.memory > 1.5f * 1024)
|
{
|
return 10;
|
}
|
else
|
{
|
return 1;
|
}
|
case RuntimePlatform.WindowsEditor:
|
return 20;
|
default:
|
return 5;
|
}
|
}
|
|
private void OnApplicationOut()
|
{
|
isPlaying = false;
|
}
|
|
}
|