public override void OnInspectorGUI()
    {
        MegaLoftLayerCloneSplineSimple layer = (MegaLoftLayerCloneSplineSimple)target;
        MegaShapeLoft loft = layer.GetComponent <MegaShapeLoft>();

        if (loft && loft.undo)
        {
            undoManager.CheckUndo();
        }

        DisplayGUI();
        CommonGUI();

        if (GUI.changed)
        {
            if (loft)
            {
                loft.rebuild = true;
                EditorUtility.SetDirty(loft);
            }

            if (layer)
            {
                EditorUtility.SetDirty(layer);
            }
        }

        if (loft && loft.undo)
        {
            undoManager.CheckDirty();
        }
    }