public void UpdateVSync(MenuSettings.VSync vsync) { QualitySettings.vSyncCount = (int)vsync; }
public void DrawMenuSettings(SerializedProperty sett, string label, uint expandSpace = 0) { sett.isExpanded = EditorGUILayout.Foldout(sett.isExpanded, label); if (sett.isExpanded) { EditorGUI.indentLevel++; settingsFileName.stringValue = EditorGUILayout.TextField("File Name", settingsFileName.stringValue); SerializedProperty volume = sett.FindPropertyRelative("volume"); SerializedProperty shadows = sett.FindPropertyRelative("shadows"); SerializedProperty shadowsQuality = sett.FindPropertyRelative("shadowsQuality"); SerializedProperty antiAliasing = sett.FindPropertyRelative("antiAliasing"); SerializedProperty anisotropicFiltering = sett.FindPropertyRelative("anisotropicFiltering"); SerializedProperty realTimeReflections = sett.FindPropertyRelative("realTimeReflections"); SerializedProperty vSync = sett.FindPropertyRelative("vSync"); SerializedProperty resolution = sett.FindPropertyRelative("resolution"); SerializedProperty fullScreen = sett.FindPropertyRelative("fullScreen"); MenuSettings.Shadow shadowsE = (MenuSettings.Shadow)shadows.enumValueIndex; MenuSettings.ShadowQuality shadowsQualityE = (MenuSettings.ShadowQuality)shadowsQuality.enumValueIndex; MenuSettings.AntiAliasing antiAliasingE = (MenuSettings.AntiAliasing)antiAliasing.enumValueIndex; AnisotropicFiltering AF = (AnisotropicFiltering)anisotropicFiltering.enumValueIndex; MenuSettings.VSync vSyncE = (MenuSettings.VSync)vSync.enumValueIndex; volume.floatValue = EditorGUILayout.Slider("Volume", volume.floatValue, 0, 1); shadowsE = (MenuSettings.Shadow)EditorGUILayout.EnumPopup("Shadows", shadowsE); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Shadows Quality"); shadowsQualityE = (MenuSettings.ShadowQuality)EditorGUILayout.EnumPopup(shadowsQualityE); EditorGUILayout.EndHorizontal(); antiAliasingE = (MenuSettings.AntiAliasing)EditorGUILayout.EnumPopup("AntiAliasing", antiAliasingE); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Anisotropic Filtering"); AF = (AnisotropicFiltering)EditorGUILayout.EnumPopup(AF); EditorGUILayout.EndHorizontal(); shadows.enumValueIndex = (int)shadowsE; shadowsQuality.enumValueIndex = (int)shadowsQualityE; antiAliasing.enumValueIndex = (int)antiAliasingE; anisotropicFiltering.enumValueIndex = (int)AF; EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("RealTime Reflections"); realTimeReflections.boolValue = EditorGUILayout.Toggle(realTimeReflections.boolValue); EditorGUILayout.EndHorizontal(); vSyncE = (MenuSettings.VSync)EditorGUILayout.EnumPopup("V-Sync", vSyncE); vSync.enumValueIndex = (int)vSyncE; resolution.intValue = EditorGUILayout.IntField("Resolution Index", resolution.intValue); fullScreen.boolValue = EditorGUILayout.Toggle("Full Screen", fullScreen.boolValue); EditorGUI.indentLevel--; InspectorTools.Space(expandSpace); } }