Unity 设置分辨率 设置画质(PC)

2021-01-04 02:29

阅读:519

标签:ase   screen   break   oid   solution   efs   deb   class   color   

分辨率

 public void ResolutionRatio(int value)
    {
        // Debug.Log(value);

        PlayerPrefs.SetInt("ResolutionRatio", value);
        switch (value)
        {
            case 0:
                if (PlayerPrefs.HasKey("resolutionsW"))
                {
                    Screen.SetResolution(PlayerPrefs.GetInt("resolutionsW"), PlayerPrefs.GetInt("resolutionsH"), true);

                }
                break;
            case 1:
                Screen.SetResolution(640, 480, true);
                break;
            case 2:
                Screen.SetResolution(1280, 720, true);
                break;
            case 3:
                Screen.SetResolution(1920, 1080, true);
                break;

            default:
                break;
        }
    }

画质

  QualitySettings.SetQualityLevel(value, true);

1~6

Unity 设置分辨率 设置画质(PC)

标签:ase   screen   break   oid   solution   efs   deb   class   color   

原文地址:https://www.cnblogs.com/DGJS/p/12986395.html


评论


亲,登录后才可以留言!