override public void OnInspectorGUI()
    {
        if (target == null || serializedObject == null)
        {
            return;
        }
        serializedObject.Update();

        EditorGUILayout.PropertyField(trisToQuadsProp,
                                      new GUIContent("Tris to Quads", "This will merge adjacent triangles to quads. It starts with the lowest edge angle and will not dissolve special edges (uv seams etc.)"));
        if (trisToQuadsProp.boolValue)
        {
            trisToQuadsMaxEdgeAngleProp.floatValue = EditorGUILayout.Slider(new GUIContent("   Max Edge Angle", "Edges with a face angle below this value can be dissolved, creating a quad from two triangles."),
                                                                            trisToQuadsMaxEdgeAngleProp.floatValue, 0.0f, 180.0f);
        }

        /*EditorGUILayout.BeginHorizontal();
         * EditorGUILayout.LabelField("Normal Mode");
         * bool val = false;
         * GUILayout.Toggle(val, "Interpolate", EditorStyles.radioButton, GUILayout.ExpandWidth(false));
         * GUILayout.Toggle(val, "Recalculate", EditorStyles.radioButton, GUILayout.ExpandWidth(false));
         * GUILayout.FlexibleSpace();
         * EditorGUILayout.EndHorizontal();*/

        EditorGUILayout.PropertyField(normalModeProp, new GUIContent("Normal Mode",
                                                                     "Interpolate - linearly interpolate normals of the input mesh during the subdivision.\n" +
                                                                     "Recalculate - calculate new normals based on the mesh shape once the subdivision is complete."));

        KrablMesh.UnityEditorUtils.OnPropGUIDelegate onPropGUIDel = delegate(SerializedProperty prop) {
            KrablMesh.UnityEditorUtils.GUILayoutPlusMinusIntProperty(prop, new GUIContent("Iterations", "For every iteration every face is split into four quads. High iteration counts can lead to lots of faces and slow processing."));
            prop.intValue = Mathf.Clamp(prop.intValue, 0, 9);

            if (prop.intValue > 3)
            {
                EditorGUILayout.HelpBox("High iteration counts quickly lead to meshes with lots of vertices and faces.\n" + "" +
                                        "Every iterations multiplies the face count by ~4 and the vertex count by ~3.\n" +
                                        "Later processors can take a long time to process large meshes.\n" +
                                        "Unity can only handle (result) meshes with less than 65536 vertices.", MessageType.Warning);
            }
        };

        if (usedByMeshImporter)
        {
            KrablMesh.UnityEditorUtils.GUILayoutPlatformDependantProperty(
                iterationsProp,
                iterationsOverrideProp,
                iterationsOverridePlatformProp,
                onPropGUIDel
                );
        }
        else
        {
            onPropGUIDel(iterationsProp);
        }

        base.modifiedDuringLastUpdate = serializedObject.ApplyModifiedProperties();
    }
    override public void OnInspectorGUI()
    {
        if (target == null || serializedObject == null)
        {
            return;
        }

        serializedObject.Update();

        EditorGUILayout.PropertyField(allowVertexRepositionProp, new GUIContent(
                                          "Allow Vertex Repositioning",
                                          "Calculating new vertex positions leads to a more accurate mesh shape " +
                                          "but can have a negative impact on mesh attributes (UVs, skin, colors, ...)." +
                                          "Disabling Repositioning will speed up calculations."));

        EditorGUILayout.PropertyField(preventNonManifoldEdgesProp, new GUIContent(
                                          "Protect Details",
                                          "Enable to prevent small independent mesh features to be totally removed.\n" +
                                          "Protecting details is not recommended for low target polygon counts."));

        advancedSettingsVisibleProp.boolValue = EditorGUILayout.Foldout(advancedSettingsVisibleProp.boolValue, new GUIContent("Simplification Weights (Advanced)",
                                                                                                                              "Extend the weights section by clicking on the small triangle to the left." +
                                                                                                                              "This is a group of parameters that affect how the mesh is simplified. " +
                                                                                                                              "They determine which edges get collapsed first and allow to preserve special features of a mesh."));
        if (advancedSettingsVisibleProp.boolValue)
        {
            GUIStyle insetStyle = new GUIStyle();
            insetStyle.margin        = new RectOffset(10, 0, 0, 0);
            insetStyle.contentOffset = new Vector2(10.0f, 0.0f);
            EditorGUILayout.BeginVertical(insetStyle);
            _constraintSlider(bordersProp, new GUIContent("Mesh Borders", "The amount of protection for edges at mesh borders (edges only connected to one face)"));
            _constraintSlider(creasesProp, new GUIContent("Creases", "The Amount of protection for edges that have been marked as creases.\n" +
                                                          "At the beginning of processing all edges with normal breaks are automatically marked as creases. Different edges can be marked as creases with the 'Detect Creases' processor."));
            _constraintSlider(uvSeamsProp, new GUIContent("UV Seams", "The amount of protection for edges that are part of two UV islands."));
            _constraintSlider(uv2SeamsProp, new GUIContent("UV2 Seams", "The amount of protection for edges that are part of two UV2 islands."));
            _constraintSlider(materialSeamsProp, new GUIContent("Material Seams", "The amount of protection for edges connecting faces with different materials."));

            EditorGUILayout.Separator();
            _constraintSlider(boneWeightProtectionProp, new GUIContent("Bone Weights", "The amount of protection for edges which have different bone weights at their two vertices.\n" + "" +
                                                                       "This will prevent flexible areas of skinned meshes from being simplified."));
            _constraintSlider(vertexColorProtectionProp, new GUIContent("Vertex Colors", "The amount of protection for edges which have different vertex colors at their two vertices.\n" + "" +
                                                                        "This will prevent areas with changing vertex colors from being simplified."));

            EditorGUILayout.EndVertical();
        }

        KrablMesh.UnityEditorUtils.OnPropGUIDelegate onPropGUIDel = delegate(SerializedProperty prop) {
            EditorGUILayout.PropertyField(prop, new GUIContent("Target Triangle Count", "The number of triangles the result mesh should have\n" +
                                                               "It's possible simplification will end up with up to three faces less because single faces can not be independently removed"));
            if (prop.intValue < 0)
            {
                prop.intValue = 0;
            }
        };

        if (usedByMeshImporter)
        {
            KrablMesh.UnityEditorUtils.GUILayoutPlatformDependantProperty(
                targetTriangleCountProp,
                ttcOverrideTargetTriangleCountProp,
                ttcOverridePlatformProp,
                onPropGUIDel
                );
        }
        else
        {
            onPropGUIDel(targetTriangleCountProp);
        }

        //	EditorGUILayout.PropertyField(maximumErrorProp, new GUIContent("Maximum Error", ""));
        //	maximumErrorProp.floatValue = Mathf.Clamp(maximumErrorProp.floatValue, 0.0f, 1000.0f);

        base.modifiedDuringLastUpdate = serializedObject.ApplyModifiedProperties();
    }