Unity 设置分辨率 设置画质(PC)
分辨率
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