示例#1
0
 private void Update()
 {
     GraphicsUtils.RebindAllRenderTexturesToCamera();
     if (Singleton <QAManager> .Instance != null)
     {
         Singleton <QAManager> .Instance.UpdateSendMessageToSever();
     }
     this._applicationManager.ManualCoroutinesMoveNext();
     this._applicationManager.ClearFinishCoroutines();
 }
示例#2
0
        public static void ApplyResolution(Dictionary <ResolutionQualityGrade, int> resolutionPercentage, ResolutionQualityGrade resolutionQuality, int recommendResX, int recommendResY)
        {
            ResolutionQualityGrade grade      = resolutionQuality;
            int currentScreenResolutionWidth  = 0;
            int currentScreenResolutionHeight = 0;

            SetScreenResolution(grade, ref currentScreenResolutionWidth, ref currentScreenResolutionHeight);
            int num3 = resolutionPercentage[grade];
            int resX = Mathf.RoundToInt(((float)(currentScreenResolutionWidth * num3)) / 100f);
            int resY = Mathf.RoundToInt(((float)(currentScreenResolutionHeight * num3)) / 100f);

            switch (grade)
            {
            case ResolutionQualityGrade.Middle:
            case ResolutionQualityGrade.Low:
                GetResolutionKeepScale(recommendResX, recommendResY, currentScreenResolutionWidth, currentScreenResolutionHeight, ref resX, ref resY);
                if (grade == ResolutionQualityGrade.Low)
                {
                    resX = Mathf.RoundToInt(((float)(resX * num3)) / 100f);
                    resY = Mathf.RoundToInt(((float)(resY * num3)) / 100f);
                }
                break;
            }
            _UsingNativeResolution = (resX == currentScreenResolutionWidth) && (resY == currentScreenResolutionHeight);
            _UsingResolutionX      = resX;
            _UsingResolutionY      = resY;
            PostFXWithResScale scale = UnityEngine.Object.FindObjectOfType <PostFXWithResScale>();

            if ((scale != null) && scale.enabled)
            {
                scale.CameraResWidth  = resX;
                scale.CameraResHeight = resY;
            }
            else
            {
                Screen.SetResolution(resX, resY, Screen.fullScreen);
            }
            GraphicsUtils.RebindAllRenderTexturesToCamera();
        }