Пример #1
0
    public static int GetSmartFPS()
    {
        int[] array = new int[]
        {
            60,
            40,
            30,
            25,
            20,
            15
        };
        int level = TsHardwareAnalyzer.GetLevel();
        int num   = Mathf.Clamp(level - 1, 0, array.Length - 1);

        return(array[num]);
    }
Пример #2
0
    public static void ApplySmartFPS()
    {
        NmMainFrameWork.MAX_FPS = 60;
        int num;

        if (PlayerPrefs.HasKey("SaveFps"))
        {
            num = PlayerPrefs.GetInt("SaveFps");
        }
        else
        {
            num = NmMainFrameWork.MAX_FPS;
        }
        Application.targetFrameRate = num;
        TsLog.LogWarning("SmartFPS={0} (H/W level={1} Mem = {2}) ", new object[]
        {
            num,
            TsHardwareAnalyzer.GetLevel(),
            SystemInfo.systemMemorySize
        });
    }