Ejemplo n.º 1
0
        void UpdateSetting(PointerEventData obj)
        {
            Global.Ins.fps = _t30fps.isOn ? 30 : 60;

            if (_tLowQuality.isOn)
            {
                Global.Ins.quality = 0;
            }
            else if (_tMiddleQuality.isOn)
            {
                Global.Ins.quality = 1;
            }
            else if (_tHighQuality.isOn)
            {
                Global.Ins.quality = 2;
            }

            if (_tLowResolution.isOn)
            {
                Global.Ins.resolution     = 0;
                Global.Ins.resolutionSize = ScreenUtil.AdaptationResolution(Global.Ins.defaultResolution.x, Global.Ins.defaultResolution.y, 1280, 720, false);
            }
            else if (_tNormalResolution.isOn)
            {
                Global.Ins.resolution = 1;
            }
            else if (_tHighResolution.isOn)
            {
                Global.Ins.resolution = 2;
            }

            Global.Ins.RefreshConfig();
        }
Ejemplo n.º 2
0
        public void RefreshConfig()
        {
            Application.targetFrameRate = fps;
            QualitySettings.SetQualityLevel(quality);
            switch (resolution)
            {
            case 0:
                resolutionSize = ScreenUtil.AdaptationResolution(defaultResolution.x, defaultResolution.y, 1280, 720, false);
                break;

            case 1:
                resolutionSize = ScreenUtil.AdaptationResolution(defaultResolution.x, defaultResolution.y, 1280, 720, true);
                break;

            case 2:
                resolutionSize = defaultResolution;
                break;
            }
        }