示例#1
0
        private static SGameRenderQuality checkGPU_Mali(string[] tokens)
        {
            int num = 0;
            SGameRenderQuality result = SGameRenderQuality.Low;

            for (int i = 1; i < tokens.Length; i++)
            {
                string text = tokens[i];
                if (text.get_Length() >= 3)
                {
                    int  num2 = text.LastIndexOf("mp");
                    bool flag = text.get_Chars(0) == 't';
                    if (num2 > 0)
                    {
                        int num3 = (!flag) ? 0 : 1;
                        text = text.Substring(num3, num2 - num3);
                        DetectRenderQuality.TryGetInt(ref num, text);
                    }
                    else
                    {
                        if (flag)
                        {
                            text = text.Substring(1);
                        }
                        if (DetectRenderQuality.TryGetInt(ref num, text))
                        {
                            for (int j = i + 1; j < tokens.Length; j++)
                            {
                                text = tokens[j];
                                if (text.IndexOf("mp") >= 0)
                                {
                                    break;
                                }
                            }
                        }
                    }
                    if (num > 0)
                    {
                        if (num < 400)
                        {
                            result = SGameRenderQuality.Low;
                        }
                        else if (num < 500)
                        {
                            if (num == 400)
                            {
                                result = SGameRenderQuality.Low;
                            }
                            else if (num == 450)
                            {
                                result = SGameRenderQuality.Medium;
                            }
                            else
                            {
                                result = SGameRenderQuality.Low;
                            }
                        }
                        else if (num < 700)
                        {
                            if (!flag)
                            {
                                result = SGameRenderQuality.Low;
                            }
                            else if (num < 620)
                            {
                                result = SGameRenderQuality.Low;
                            }
                            else if (num < 628)
                            {
                                result = SGameRenderQuality.Medium;
                            }
                            else
                            {
                                result = SGameRenderQuality.High;
                            }
                        }
                        else if (!flag)
                        {
                            result = SGameRenderQuality.Low;
                        }
                        else
                        {
                            result = SGameRenderQuality.High;
                        }
                        break;
                    }
                }
            }
            return(result);
        }
        public static void Init()
        {
            GameSettings.DeviceLevel = SGameRenderQuality.Low;
            GameSettings.DeviceLevel = DetectRenderQuality.check_Android();
            if (PlayerPrefs.HasKey("sgameSettings_RenderQuality"))
            {
                int @int = PlayerPrefs.GetInt("sgameSettings_RenderQuality", 0);
                GameSettings.RenderQuality = (SGameRenderQuality)Mathf.Clamp(@int, 0, 2);
            }
            else
            {
                GameSettings.RenderQuality = GameSettings.DeviceLevel;
            }
            if (PlayerPrefs.HasKey("sgameSettings_ParticleQuality"))
            {
                int int2 = PlayerPrefs.GetInt("sgameSettings_ParticleQuality", 0);
                GameSettings.ParticleQuality = (SGameRenderQuality)Mathf.Clamp(int2, 0, 2);
            }
            else
            {
                GameSettings.ParticleQuality = GameSettings.RenderQuality;
            }
            int int3 = PlayerPrefs.GetInt("sgameSettings_muteSound", 1);

            GameSettings.EnableSound = (int3 == 1);
            int int4 = PlayerPrefs.GetInt("sgameSettings_muteMusic", 1);

            GameSettings.EnableMusic = (int4 == 1);
            if (PlayerPrefs.HasKey("sgameSettings_EnableVoice"))
            {
                int int5 = PlayerPrefs.GetInt("sgameSettings_EnableVoice", 1);
                GameSettings.EnableVoice = (int5 == 1);
            }
            else
            {
                GameSettings.EnableVoice = false;
            }
            int int6 = PlayerPrefs.GetInt("GameSettingEnableVibrate", 1);

            GameSettings.EnableVibrate              = (int6 == 1);
            GameSettings.EnableHeroInfo             = (PlayerPrefs.GetInt("GameSettings_HeroInfoShowEnable", 1) == 1);
            GameSettings.HeroSelectHeroViewSortType = (CMallSortHelper.HeroViewSortType)PlayerPrefs.GetInt("GameSettingSelectHeroSortType", 1);
            GameSettings.ShowEquipInfo              = (PlayerPrefs.GetInt("GameSettingShowEquipInfo", 1) == 1);
            int int7 = PlayerPrefs.GetInt("GameSettingEnableReplayKit", 0);

            GameSettings.EnableReplayKit = (int7 == 1);
            int int8 = PlayerPrefs.GetInt("GameSettingEnableReplayKitAutoMode", 0);

            GameSettings.EnableReplayKitAutoMode = (int8 == 1);
            int int9 = PlayerPrefs.GetInt("GameSettingEnableKingTime", 0);

            GameSettings.EnableKingTimeMode = (int9 == 1);
            if (GameSettings.EnableKingTimeMode)
            {
                GameSettings.EnableRecorderMode = false;
            }
            else
            {
                int int10 = PlayerPrefs.GetInt("GameSettingEnableRecorderMode", 0);
                GameSettings.EnableRecorderMode = (int10 == 1);
            }
            int int11 = PlayerPrefs.GetInt("GameSettingEnableRecordVideoHighQualityMode", 0);

            GameSettings.EnableRecordVideoHighQualityMode = (int11 == 1);
            GameSettings.EnableOutline       = (PlayerPrefs.GetInt("sgameSettings_outline", 0) != 0);
            GameSettings.TheCastType         = (CastType)PlayerPrefs.GetInt("GameSettings_CastType", 1);
            GameSettings.TheCommonAttackType = (CommonAttactType)PlayerPrefs.GetInt("GameSetting_CommonAttackType", 0);
            GameSettings.TheSelectType       = (SelectEnemyType)PlayerPrefs.GetInt("GameSettings_SelectEnemyType", 1);
            GameSettings.TheLastHitMode      = (LastHitMode)PlayerPrefs.GetInt("GameSetting_LastHitMode", 0);
            GameSettings.TheAttackOrganMode  = (AttackOrganMode)PlayerPrefs.GetInt("GameSetting_LastHitMode", 0);
            GameSettings.s_lunpanSensitivity = (PlayerPrefs.HasKey("GameSettings_LunPanCastSensitivity") ? PlayerPrefs.GetFloat("GameSettings_LunPanCastSensitivity", 1f) : 1f);
            GameSettings.TheSkillCancleType  = (SkillCancleType)PlayerPrefs.GetInt("GameSettingSkillCancleType", 0);
            GameSettings.TheCameraMoveType   = (CameraMoveType)PlayerPrefs.GetInt("GameSettingCameraMoveType", 0);
            GameSettings.YaoGanSensitivity   = PlayerPrefs.GetFloat("GameSettingCameraYaoGanSensitivity", 25000f);
            GameSettings.HuaDongSensitivity  = PlayerPrefs.GetFloat("GameSettingCameraHuaDongSensitivity", 100f);
            GameSettings.MusicEffectLevel    = (PlayerPrefs.HasKey("GameSettingMusicEffectLevel") ? PlayerPrefs.GetFloat("GameSettingMusicEffectLevel", 100f) : 100f);
            GameSettings.SoundEffectLevel    = (PlayerPrefs.HasKey("GameSettingSoundEffectLevel") ? PlayerPrefs.GetFloat("GameSettingSoundEffectLevel", 100f) : 100f);
            GameSettings.VoiceEffectLevel    = (PlayerPrefs.HasKey("GameSettingVoiceEffectLevel") ? PlayerPrefs.GetFloat("GameSettingVoiceEffectLevel", 100f) : 100f);
            if (GameSettings.DeviceLevel == SGameRenderQuality.Low)
            {
                GameSettings.cameraHeight = CameraHeightType.Low;
            }
            else
            {
                GameSettings.cameraHeight = CameraHeightType.Medium;
            }
            if (PlayerPrefs.HasKey("cameraHeight"))
            {
                GameSettings.CameraHeight = PlayerPrefs.GetInt("cameraHeight", 1);
            }
            GameSettings.JoyStickMoveType = PlayerPrefs.GetInt("joystickMoveType", 1);
            GameSettings.JoyStickShowType = PlayerPrefs.GetInt("joystickShowType", 0);
            GameSettings.FpsShowType      = PlayerPrefs.GetInt("str_fpsShowType", 0);
            GameSettings.m_clickEnableInBattleInputChat = PlayerPrefs.GetInt("str_inBatInputShowType", 1);
            GameSettings.LunPanLockEnemyHeroMode        = (PlayerPrefs.GetInt("GameSettingEnableLunPanLockEnemyHeroMode", 0) == 1);
            GameSettings.ShowEnemyHeroHeadBtnMode       = (PlayerPrefs.GetInt("GameSettingEnableShowEnemyHeroHeadBtnMode", 0) == 1);
            GameSettings.MiniMapPosMode = (MiniMapPosType)PlayerPrefs.GetInt("GameSettingMiniMapPosType", 0);
            GameSettings.EquipPosMode   = (EquipPosType)PlayerPrefs.GetInt("GameSettingEquipPosType", 0);
        }