static void HandleColorPreferences(string searchContext) { EditorGUI.BeginChangeCheck(); s_UseUnityColors.value = SettingsGUILayout.SettingsToggle("Use Unity Colors", s_UseUnityColors, searchContext); if (!s_UseUnityColors.value) { using (new SettingsGUILayout.IndentedGroup()) { s_DitherFaceHandle.value = SettingsGUILayout.SettingsToggle("Dither Face Overlay", s_DitherFaceHandle, searchContext); s_WireframeColorPref.value = SettingsGUILayout.SettingsColorField("Wireframe", s_WireframeColorPref, searchContext); s_PreselectionColorPref.value = SettingsGUILayout.SettingsColorField("Preselection", s_PreselectionColorPref, searchContext); s_SelectedFaceColorPref.value = SettingsGUILayout.SettingsColorField("Selected Face Color", s_SelectedFaceColorPref, searchContext); s_UnselectedEdgeColorPref.value = SettingsGUILayout.SettingsColorField("Unselected Edge Color", s_UnselectedEdgeColorPref, searchContext); s_SelectedEdgeColorPref.value = SettingsGUILayout.SettingsColorField("Selected Edge Color", s_SelectedEdgeColorPref, searchContext); s_UnselectedVertexColorPref.value = SettingsGUILayout.SettingsColorField("Unselected Vertex Color", s_UnselectedVertexColorPref, searchContext); s_SelectedVertexColorPref.value = SettingsGUILayout.SettingsColorField("Selected Vertex Color", s_SelectedVertexColorPref, searchContext); } } s_DepthTestHandles.value = SettingsGUILayout.SettingsToggle("Depth Test", s_DepthTestHandles, searchContext); s_VertexPointSize.value = SettingsGUILayout.SettingsSlider("Vertex Size", s_VertexPointSize, 1f, 10f, searchContext); s_EdgeLineSize.value = SettingsGUILayout.SettingsSlider("Line Size", s_EdgeLineSize, 0f, 10f, searchContext); s_WireframeLineSize.value = SettingsGUILayout.SettingsSlider("Wireframe Size", s_WireframeLineSize, 0f, 10f, searchContext); if (EditorGUI.EndChangeCheck()) { ProBuilderEditor.UpdateMeshHandles(true); } }
static void ConditionalValueGUI(string searchContext) { EditorGUI.BeginChangeCheck(); s_NumberWithSlider.value = SettingsGUILayout.SettingsSlider("Number With Slider", s_NumberWithSlider, 0, 10, searchContext); var foo = s_Foo.value; using (new SettingsGUILayout.IndentedGroup("Foo Class")) { EditorGUI.BeginChangeCheck(); foo.intValue = SettingsGUILayout.SearchableIntField("Int Value", foo.intValue, searchContext); foo.stringValue = SettingsGUILayout.SearchableTextField("String Value", foo.stringValue, searchContext); // Because FooClass is a reference type, we need to apply the changes to the backing repository (SetValue // would also work here). if (EditorGUI.EndChangeCheck()) { s_Foo.ApplyModifiedProperties(); } } SettingsGUILayout.DoResetContextMenuForLastRect(s_Foo); if (EditorGUI.EndChangeCheck()) { MySettingsManager.Save(); } }
private static void GraphZoomSettings(string searchContext) { EditorGUI.BeginChangeCheck(); zoomSpeed.value = SettingsGUILayout.SettingsSlider("Speed", zoomSpeed, -1f, 1f, searchContext); minZoom.value = SettingsGUILayout.SettingsSlider("Minimum", minZoom, 0.01f, 1f, searchContext); maxZoom.value = SettingsGUILayout.SettingsSlider("Maximum", maxZoom, 1f, 100f, searchContext); if (EditorGUI.EndChangeCheck()) { zoomSpeed.ApplyModifiedProperties(); minZoom.ApplyModifiedProperties(); maxZoom.ApplyModifiedProperties(); } }
static void HandleColorPreferences(string searchContext) { s_UseUnityColors.value = SettingsGUILayout.SettingsToggle("Use Unity Colors", s_UseUnityColors, searchContext); if (!s_UseUnityColors.value) { using (new SettingsGUILayout.IndentedGroup()) { s_DitherFaceHandle.value = SettingsGUILayout.SettingsToggle("Dither Face Overlay", s_DitherFaceHandle, searchContext); s_WireframeColorPref.value = SettingsGUILayout.SettingsColorField("Wireframe", s_WireframeColorPref, searchContext); s_PreselectionColorPref.value = SettingsGUILayout.SettingsColorField("Preselection", s_PreselectionColorPref, searchContext); s_SelectedFaceColorPref.value = SettingsGUILayout.SettingsColorField("Selected Face Color", s_SelectedFaceColorPref, searchContext); s_UnselectedEdgeColorPref.value = SettingsGUILayout.SettingsColorField("Unselected Edge Color", s_UnselectedEdgeColorPref, searchContext); s_SelectedEdgeColorPref.value = SettingsGUILayout.SettingsColorField("Selected Edge Color", s_SelectedEdgeColorPref, searchContext); s_UnselectedVertexColorPref.value = SettingsGUILayout.SettingsColorField("Unselected Vertex Color", s_UnselectedVertexColorPref, searchContext); s_SelectedVertexColorPref.value = SettingsGUILayout.SettingsColorField("Selected Vertex Color", s_SelectedVertexColorPref, searchContext); } } s_DepthTestHandles.value = SettingsGUILayout.SettingsToggle("Depth Test", s_DepthTestHandles, searchContext); s_VertexPointSize.value = SettingsGUILayout.SettingsSlider("Vertex Size", s_VertexPointSize, 1f, 10f, searchContext); bool geoLine = BuiltinMaterials.geometryShadersSupported; if (geoLine) { s_EdgeLineSize.value = SettingsGUILayout.SettingsSlider("Line Size", s_EdgeLineSize, 0f, 3f, searchContext); s_WireframeLineSize.value = SettingsGUILayout.SettingsSlider("Wireframe Size", s_WireframeLineSize, 0f, 3f, searchContext); } else { GUI.enabled = false; SettingsGUILayout.SearchableSlider("Line Size", 0f, 0f, 3f, searchContext); SettingsGUILayout.SearchableSlider("Wireframe Size", 0f, 0f, 3f, searchContext); GUI.enabled = true; } }
static void HandleBrushPreferences(string searchContext) { s_VertexBillboardSize.value = SettingsGUILayout.SettingsSlider(new GUIContent("Vertex Render Size", "The size at which selected vertices will be rendered."), s_VertexBillboardSize, 0f, 10f, searchContext); }