少年修仙传客户端代码仓库
client_Wu Xijin
2019-02-14 d627ab75aaceae1d2d1653e4f10201212c1da0e8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
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;
    }
 
}