protected override void InitOption() { List <TMP_Dropdown.OptionData> Options = new List <TMP_Dropdown.OptionData>(); foreach (string Option in typeof(EGraphicQuality).GetEnumNames()) { Options.Add(new TMP_Dropdown.OptionData(Option)); } DropdownOption.AddOptions(Options); DropdownOption.value = QualitySettings.GetQualityLevel();; }
protected override void InitOption() { List <string> options = new List <string>(); int value = -1; for (int i = 0; i < Screen.resolutions.Length; i++) { Resolution resolution = Screen.resolutions[i]; int currentRefreshRate = Screen.currentResolution.refreshRate; options.Add(resolution.ToString()); if (resolution.width == Screen.currentResolution.width && resolution.height == Screen.currentResolution.height && (currentRefreshRate - 1 <= resolution.refreshRate || resolution.refreshRate <= currentRefreshRate + 1)) //Refresh rate has +-1 margin { value = i; } } DropdownOption.AddOptions(options); DropdownOption.value = value; }
protected override void InitOption() { string[] options = typeof(FullScreenMode).GetEnumNames(); DropdownOption.AddOptions(options.ToList()); DropdownOption.value = Array.IndexOf(options, Screen.fullScreenMode.ToString()); }