예제 #1
0
    void CsharpConfigSettings()
    {
        using (new ShapesUI.AssetEditScope(ShapesConfig.Instance)) {
            using (ShapesUI.Group) {
                GUILayout.Label("Interface", EditorStyles.boldLabel);
                EditorGUILayout.PropertyField(useHdrColorPickers, new GUIContent("HDR color pickers"));
            }

            using (ShapesUI.Group) {
                GUILayout.Label("Immediate Mode", EditorStyles.boldLabel);
                EditorGUILayout.PropertyField(useImmediateModeInstancing, new GUIContent("GPU Instancing"));
                using (ShapesUI.TempLabelWidth(220))
                    EditorGUILayout.PropertyField(pushPopStateInDrawCommands, new GUIContent("Always push/pop in Draw.Command"));
                EditorGUILayout.PropertyField(polylineDefaultPointsPerTurn, new GUIContent("Default polyline density"));
                EditorGUILayout.PropertyField(polylineBezierAngularSumAccuracy, new GUIContent("Bezier accuracy"));
            }
        }
    }
예제 #2
0
    void ShaderSettings()
    {
        using (ShapesUI.Group) {
            GUILayout.Label("Shader Settings", EditorStyles.boldLabel);
            using (ShapesUI.TempLabelWidth(160)) {
                EditorGUILayout.PropertyField(FRAG_OUTPUT_V4, new GUIContent("Output precision"));
                EditorGUILayout.PropertyField(LOCAL_ANTI_ALIASING_QUALITY, new GUIContent("Local AA quality"));
                EditorGUILayout.PropertyField(QUAD_INTERPOLATION_QUALITY, new GUIContent("Quad interpolation quality"));
                EditorGUILayout.PropertyField(NOOTS_ACROSS_SCREEN, new GUIContent("Noots across screen"));
            }

            GUILayout.Space(3);
            if (ShapesUI.CenteredButton(new GUIContent("Apply shader settings", "Apply shader settings")))
            {
                ApplyShaderSettings();
            }
            GUILayout.Space(3);
        }
    }
예제 #3
0
    void DrawDetailLevelEntry(SerializedProperty prop, DetailLevel detail, int min, Func <SerializedProperty, int> triCount)
    {
        bool isInt2 = prop.propertyType == SerializedPropertyType.Vector2Int;

        using (ShapesUI.Horizontal) {
            using (ShapesUI.TempLabelWidth(100)) {
                using (var chChk = new EditorGUI.ChangeCheckScope()) {
                    if (isInt2)
                    {
                        SerializedProperty x = prop.FindPropertyRelative("x");
                        SerializedProperty y = prop.FindPropertyRelative("y");
                        EditorGUILayout.PrefixLabel(new GUIContent(detail.ToString(), "Minor & major axis divisions"));
                        using (new EditorGUI.IndentLevelScope(-2)) {
                            EditorGUILayout.PropertyField(x, GUIContent.none, GUILayout.Width(32));
                            EditorGUILayout.PropertyField(y, GUIContent.none, GUILayout.Width(32));
                        }
                    }
                    else
                    {
                        EditorGUILayout.PropertyField(prop, new GUIContent(detail.ToString()), GUILayout.Width(150));
                    }


                    if (chChk.changed)
                    {
                        // clamp
                        if (isInt2)
                        {
                            prop.vector2IntValue = new Vector2Int(Mathf.Max(min, prop.vector2IntValue.x), Mathf.Max(min, prop.vector2IntValue.y));
                        }
                        else
                        {
                            prop.intValue = Mathf.Max(min, prop.intValue);
                        }
                    }
                }
            }

            GUILayout.Label($"{triCount( prop )} tris");
        }
    }