Ejemplo n.º 1
0
        protected override void OnSceneGUI()
        {
            // Bounds
            if (CurvyGlobalManager.Gizmos.HasFlag(CurvySplineGizmos.Bounds))
            {
                DTHandles.PushHandlesColor(new Color(0.3f, 0, 0));
                DTHandles.WireCubeCap(Target.Bounds.center, Target.Bounds.size);
                DTHandles.PopHandlesColor();
            }
            Handles.BeginGUI();

            mUserValuesLabel = new GUIStyle(EditorStyles.boldLabel);
            mUserValuesLabel.normal.textColor = Color.green;


            if (CurvyGlobalManager.Gizmos.HasFlag(CurvySplineGizmos.Labels))
            {
                GUIStyle stLabel = new GUIStyle(EditorStyles.boldLabel);
                stLabel.normal.textColor = Color.white;
                Handles.Label(Target.transform.position - new Vector3(-0.5f, 0.2f, 0), Target.name, stLabel);
                stLabel.normal.textColor = Color.red;
                foreach (CurvySplineSegment cp in Target.ControlPoints)
                {
                    Handles.Label(cp.transform.position + new Vector3(-0.5f, HandleUtility.GetHandleSize(cp.transform.position) * 0.35f, 0), cp.name, stLabel);
                }
            }

            Handles.EndGUI();
            // Snap Transform
            if (Target && DT._UseSnapValuePrecision)
            {
                Target.transform.localPosition    = DTMath.SnapPrecision(Target.transform.localPosition, 3);
                Target.transform.localEulerAngles = DTMath.SnapPrecision(Target.transform.localEulerAngles, 3);
            }
        }
Ejemplo n.º 2
0
        public static void SceneGUILabels(IList <Vector3> vertices, IList <string> labels, Color col, Vector2 offset)
        {
            Dictionary <Vector3, string> labelsByPos = new Dictionary <Vector3, string>();
            int ub = Mathf.Min(vertices.Count, labels.Count);

            for (int i = 0; i < ub; i++)
            {
                string val;
                if (labelsByPos.TryGetValue(vertices[i], out val))
                {
                    labelsByPos[vertices[i]] = val + "," + labels[i];
                }
                else
                {
                    labelsByPos.Add(vertices[i], labels[i]);
                }
            }

            var style = new GUIStyle(EditorStyles.boldLabel);

            style.normal.textColor = col;
            foreach (var kv in labelsByPos)
            {
                Handles.Label(DTHandles.TranslateByPixel(kv.Key, offset), kv.Value, style);
            }
        }
Ejemplo n.º 3
0
        public static void SceneGUIPoly(IEnumerable <Vector3> vertices, Color col)
        {
            DTHandles.PushHandlesColor(col);

            Handles.DrawPolyLine(vertices as Vector3[]);
            DTHandles.PopHandlesColor();
        }
Ejemplo n.º 4
0
        void doFollowUpPopup(Rect r, CurvySplineSegment item)
        {
            var possibleTargets = (from cp in Target.ControlPoints
                                   where cp != item
                                   select cp).ToList();
            int sel = possibleTargets.IndexOf(item.FollowUp) + 1;

            var content = (from cp in possibleTargets
                           select cp.ToString()).ToList();

            content.Insert(0, " ");
            EditorGUI.BeginChangeCheck();

            if (item.FollowUp && item.FollowUp.gameObject == Selection.activeGameObject)
            {
                DTHandles.DrawSolidRectangleWithOutline(r.ScaleBy(2, 0).ShiftBy(1, -2), new Color(0f, 0, 0, 0.1f), new Color(.24f, .37f, .59f));
            }

            sel = EditorGUI.Popup(r, sel, content.ToArray());

            if (EditorGUI.EndChangeCheck())
            {
                if (sel > 0)
                {
                    item.SetFollowUp(possibleTargets[sel - 1]);
                }
                else
                {
                    item.SetFollowUp(null);
                }
            }
        }
Ejemplo n.º 5
0
        void itemGUI(Rect rect, int index, bool isActive, bool isFocused)
        {
            var item = sorted[index];
            var r    = getRects(rect);

            if (item.gameObject == Selection.activeGameObject)
            {
                DTHandles.DrawSolidRectangleWithOutline(rect.ScaleBy(4, 2), new Color(0, 0, 0.2f, 0.1f), new Color(.24f, .37f, .59f));
            }
            else if (index > 0)
            {
                DTHandles.PushHandlesColor(new Color(0.1f, 0.1f, 0.1f));
                Handles.DrawLine(new Vector2(rect.xMin - 5, rect.yMin), new Vector2(rect.xMax + 4, rect.yMin));
                DTHandles.PopHandlesColor();
            }

            bool repaint = false;
            var  cnt     = new GUIContent(item.ToString(), "Click to select");

            r[0].width = DTStyles.HtmlLinkLabel.CalcSize(cnt).x;
            if (DTGUI.LinkButton(r[0], cnt, ref repaint))// EditorStyles.label))
            {
                DTSelection.SetGameObjects(sorted[index]);
            }
            if (repaint)
            {
                Repaint();
            }

            item.ConnectionSyncPosition = GUI.Toggle(r[1], item.ConnectionSyncPosition, "");
            item.ConnectionSyncRotation = GUI.Toggle(r[8], item.ConnectionSyncRotation, "");
            if (GUI.Button(r[2], new GUIContent(CurvyStyles.DeleteSmallTexture, "Delete"), CurvyStyles.ImageButton))
            {
                item.Disconnect();
                CurvyProject.Instance.ScanConnections();
                GUIUtility.ExitGUI();
            }
            if (item.CanHaveFollowUp)
            {
                GUI.Label(r[3], "Head to");
                doFollowUpPopup(r[4], item);
                bool b = item.FollowUpHeading == ConnectionHeadingEnum.Minus;
                if (GUI.Toggle(r[5], b, new GUIContent("", "Head to spline start")) != b)
                {
                    item.FollowUpHeading = (!b) ? ConnectionHeadingEnum.Minus : ConnectionHeadingEnum.Auto;
                }
                b = item.FollowUpHeading == ConnectionHeadingEnum.Sharp;
                if (GUI.Toggle(r[6], b, new GUIContent("", "No Heading")) != b)
                {
                    item.FollowUpHeading = (!b) ? ConnectionHeadingEnum.Sharp : ConnectionHeadingEnum.Auto;
                }
                b = item.FollowUpHeading == ConnectionHeadingEnum.Plus;
                if (GUI.Toggle(r[7], b, new GUIContent("", "Head to spline end")) != b)
                {
                    item.FollowUpHeading = (!b) ? ConnectionHeadingEnum.Plus : ConnectionHeadingEnum.Auto;
                }
            }
        }
Ejemplo n.º 6
0
 public static void SceneGUIPlot(IList <Vector3> vertices, float size, Color col)
 {
     DTHandles.PushHandlesColor(col);
     foreach (var v in vertices)
     {
         Handles.CubeCap(0, v, Quaternion.identity, size * HandleUtility.GetHandleSize(v));
     }
     DTHandles.PopHandlesColor();
 }
Ejemplo n.º 7
0
        public static void SceneGUIPlot(IList <Vector3> vertices, float size, Color col)
        {
            DTHandles.PushHandlesColor(col);
            foreach (var v in vertices)
#if UNITY_5_6_OR_NEWER
            { Handles.CubeHandleCap(0, v, Quaternion.identity, size * HandleUtility.GetHandleSize(v), EventType.Repaint); }
#else
            { Handles.CubeCap(0, v, Quaternion.identity, size * HandleUtility.GetHandleSize(v)); }
#endif
            DTHandles.PopHandlesColor();
        }
Ejemplo n.º 8
0
        protected override void OnSceneGUI()
        {
            var cam = SceneView.currentDrawingSceneView.camera;

            if (cam)
            {
                for (int i = 0; i < Target.Count; i++)
                {
                    if (Target.Splines[i])
                    {
                        Handles.Label(DTHandles.TranslateByPixel(Target.Splines[i].transform.position, -15, 30), i.ToString(), mLargeFont);
                    }
                }
            }
        }
Ejemplo n.º 9
0
        void OnGroupElementGUI(Rect rect, int index, bool isActive, bool isFocused)
        {
            bool fix = (index <Target.FirstRepeating || index> Target.LastRepeating);

            if (fix)
            {
                DTHandles.DrawSolidRectangleWithOutline(rect.ShiftBy(0, -1), new Color(0, 0, 0.5f, 0.2f), new Color(0, 0, 0, 0));
            }

            var prop = serializedObject.FindProperty(string.Format("m_Groups.Array.data[{0}]", index));

            if (prop != null)
            {
                var pName           = prop.FindPropertyRelative("m_Name");
                var pRepeatingOrder = serializedObject.FindProperty("m_RepeatingOrder");
                rect.height = EditorGUIUtility.singleLineHeight;
                var r = new Rect(rect);
                EditorGUI.LabelField(new Rect(rect.x, rect.y, 30, rect.height), "#" + index.ToString() + ":");
                r.x    += 30;
                r.width = rect.width / 2 - 50;
                EditorGUI.BeginChangeCheck();
                pName.stringValue = EditorGUI.TextField(r, "", pName.stringValue);
                if (EditorGUI.EndChangeCheck())
                {
                    var tab = Node.FindTabBarAt("Default");
                    if (tab && tab.Count > index + 2)
                    {
                        tab[index + 2].Name            = string.Format("{0}:{1}", index, pName.stringValue);
                        tab[index + 2].GUIContent.text = string.Format("{0}:{1}", index, pName.stringValue);
                    }
                }



                r.x    += r.width + 10;
                r.width = rect.width / 2;
                if (!fix && pRepeatingOrder.intValue == (int)CurvyRepeatingOrderEnum.Random)
                {
                    EditorGUI.PropertyField(r, prop.FindPropertyRelative("m_Weight"), new GUIContent(""));
                }
            }
        }
Ejemplo n.º 10
0
        void drawSlot(Rect rect, int index, bool isActive, bool isFocused)
        {
            var  slot = Target.Splines[index];
            Rect r    = new Rect(rect);

            r.height       = 19;
            r.width        = rect.width - 60;
            r.y           += 2;
            slot.Spline    = EditorGUI.ObjectField(r, slot.Spline, typeof(CurvySplineBase), true) as CurvySplineBase;
            r.x           += r.width + 2;
            r.width        = 50;
            slot.LineColor = EditorGUI.ColorField(r, slot.LineColor);

            // Separator
            if (index > 0)
            {
                DTHandles.PushHandlesColor(new Color(0.1f, 0.1f, 0.1f));
                Handles.DrawLine(new Vector2(rect.xMin - 5, rect.yMin), new Vector2(rect.xMax + 4, rect.yMin));
                DTHandles.PopHandlesColor();
            }
        }
Ejemplo n.º 11
0
        public new void OnSceneGUI()
        {
            CurvySplineSegment cp;
            var cam = SceneView.currentDrawingSceneView.camera;

            if (cam && Target)
            {
                List <string> samePos = new List <string>();

                for (int i = 0; i < Target.ControlPoints.Count; i++)
                {
                    cp = Target.ControlPoints[i];
                    Color c = Color.black;
                    if (cp.ConnectionSyncPosition)
                    {
                        samePos.Add(cp.ToString());
                        c = new Color(1, 0, 0);
                    }
                    else
                    {
                        if (cp.ConnectionSyncRotation)
                        {
                            c = new Color(1, 1, 0);
                        }

                        DTGUI.PushColor(c);
                        Handles.Label(DTHandles.TranslateByPixel(cp.transform.position, 12, -12), new GUIContent(cp.ToString()));
                        DTGUI.PopColor();
                    }
                }
                if (samePos.Count > 0)
                {
                    DTGUI.PushColor(Color.white);
                    var P1 = cam.ScreenToWorldPoint(cam.WorldToScreenPoint(Target.transform.position) + new Vector3(12, -12, 0));
                    Handles.Label(P1, new GUIContent(string.Join("\n", samePos.ToArray())));
                    DTGUI.PopColor();
                }
            }
        }
Ejemplo n.º 12
0
        public override void OnModuleSceneDebugGUI()
        {
            base.OnModuleSceneDebugGUI();
            CGVolume vol = Target.InData.GetData <CGVolume>();

            if (vol)
            {
                Handles.matrix = Target.Generator.transform.localToWorldMatrix;

                if (Target.ShowPathSamples)
                {
                    CGEditorUtility.SceneGUIPlot(vol.Position, 0.1f, Target.PathColor);
                    if (Target.ShowIndex)
                    {
                        var labels = Enumerable.Range(0, vol.Count).Select(i => i.ToString()).ToArray <string>();
                        CGEditorUtility.SceneGUILabels(vol.Position, labels, Color.black, Vector2.zero);
                    }
                }
                if (Target.ShowCrossSamples)
                {
                    int vtLo = Target.LimitCross.From * vol.CrossSize;
                    int vtHi = vtLo + vol.CrossSize;
                    if (!Target.LimitCross.SimpleValue)
                    {
                        vtLo = Target.LimitCross.Low * vol.CrossSize;
                        vtHi = (Target.LimitCross.High + 1) * vol.CrossSize;
                    }

                    vtLo = Mathf.Clamp(vtLo, 0, vol.VertexCount);
                    vtHi = Mathf.Clamp(vtHi, vtLo, vol.VertexCount);
                    var range = vol.Vertex.SubArray <Vector3>(vtLo, vtHi - vtLo);
                    CGEditorUtility.SceneGUIPlot(range, 0.1f, Color.white);

                    if (Target.ShowIndex)
                    {
                        var labels = Enumerable.Range(vtLo, vtHi).Select(i => i.ToString()).ToArray <string>();
                        CGEditorUtility.SceneGUILabels(range, labels, Color.black, Vector2.zero);
                    }

                    if (Target.ShowMap)
                    {
                        var labels = Enumerable.Range(vtLo, vtHi).Select(i => DTMath.SnapPrecision(vol.CrossMap[i], 3).ToString()).ToArray <string>();
                        CGEditorUtility.SceneGUILabels(range, labels, new Color(1, 0, 1), new Vector2(10, 20));
                    }

                    if (Target.ShowNormals)
                    {
                        DTHandles.PushHandlesColor(Target.NormalColor);

                        for (int i = vtLo; i < vtHi; i++)
                        {
                            Handles.DrawLine(vol.Vertex[i], vol.Vertex[i] + vol.VertexNormal[i] * 2);
                        }

                        DTHandles.PopHandlesColor();
                    }
                }
                if (Target.Interpolate)
                {
                    Vector3 pos;
                    Vector3 tan;
                    Vector3 up;
                    vol.InterpolateVolume(Target.InterpolatePathF, Target.InterpolateCrossF, out pos, out tan, out up);
                    Handles.ConeCap(0, pos, Quaternion.LookRotation(up, tan), 1f);
                }
                Handles.matrix = Matrix4x4.identity;
            }
        }
        protected override void OnSceneGUI()
        {
            // Bounds
            if (CurvyGlobalManager.Gizmos.HasFlag(CurvySplineGizmos.Bounds))
            {
                DTHandles.PushHandlesColor(Color.gray);
                DTHandles.WireCubeCap(Target.Bounds.center, Target.Bounds.size);
                DTHandles.PopHandlesColor();
            }
            checkHotkeys();
            if (Target.Spline.RestrictTo2D && Tools.current == Tool.Move && !SceneView.currentDrawingSceneView.in2DMode)
            {
                Tools.hidden = true;
                Vector3 handlePos = (Tools.handlePosition != Target.transform.position) ? DTSelection.GetPosition() : Tools.handlePosition;
                Vector3 delta;
                EditorGUI.BeginChangeCheck();


                if (CurvyProject.Instance.UseTiny2DHandles)
                {
                    delta = DTHandles.TinyHandle2D(GUIUtility.GetControlID(GetHashCode(), FocusType.Passive), handlePos, Target.Spline.transform.rotation, 1) - handlePos;
                }
                else
                {
                    delta = DTHandles.PositionHandle2D(GUIUtility.GetControlID(GetHashCode(), FocusType.Passive), handlePos, Target.Spline.transform.rotation, 1) - handlePos;
                }

                if (EditorGUI.EndChangeCheck())
                {
                    foreach (var t in Selection.transforms)
                    {
                        Undo.ClearUndo(t);
                        Undo.RecordObject(t, "Move");
                        t.position += delta;
                    }
                }
            }
            else
            {
                Tools.hidden = false;
            }


            // Bezier-Handles
            if (Target.Spline.Interpolation == CurvyInterpolation.Bezier && !Target.AutoHandles)
            {
                #region --- Bezier Rotation Handling ---
                if (Tools.current == Tool.Rotate)
                {
                    Event e = Event.current;
                    if (e.shift && DTHandles.MouseOverSceneView)
                    {
                        Tools.hidden = true;
                        DTToolbarItem._StatusBar.Set("BezierRotate");
                        // This looks good, but then diff down below isn't working like intended:
                        //mBezierRot = Quaternion.LookRotation(Vector3.Cross(Target.HandleIn, Target.GetOrientationUpFast(0)), Target.GetOrientationUpFast(0));
                        Quaternion newRot = Handles.RotationHandle(mBezierRot, Target.transform.position);
                        if (newRot != mBezierRot)
                        {
                            Quaternion diff = Quaternion.Inverse(mBezierRot) * newRot;
                            mBezierRot = newRot;
                            var mode = CurvyProject.Instance.BezierMode | CurvyBezierModeEnum.Direction;
                            Undo.RecordObject(Target, "Rotate Handles");
                            Target.SetBezierHandleIn(diff * Target.HandleIn, Space.Self, mode);
                            Target.SetDirty();
                            EditorUtility.SetDirty(Target);
                        }
                    }
                    else
                    {
                        DTToolbarItem._StatusBar.Set("Hold <b>[Shift]</b> to rotate Handles", "BezierRotate");
                        Tools.hidden = false;
                    }
                }
                else
                {
                    DTToolbarItem._StatusBar.Set("BezierRotate");
                }
                #endregion

                #region --- Bezier Movement Handling ---
                //Belongs to Constraint Length:
                //Vector3 handleOut = Target.HandleOutPosition;
                //Vector3 handleIn = Target.HandleInPosition;

                EditorGUI.BeginChangeCheck();
                Vector3 pOut;
                Vector3 pIn;
                bool    chgOut = false;
                bool    chgIn  = false;
                if (Target.Spline.RestrictTo2D)
                {
                    Quaternion r = (Tools.pivotRotation == PivotRotation.Global) ? Target.Spline.transform.localRotation : Target.Spline.transform.rotation;
                    Handles.color = Color.yellow;
                    pIn           = Target.HandleInPosition;
                    pIn           = DTHandles.TinyHandle2D(GUIUtility.GetControlID(FocusType.Passive), pIn, r, CurvyGlobalManager.GizmoControlPointSize * 0.7f, Handles.CubeCap);
                    if (!CurvyProject.Instance.UseTiny2DHandles)
                    {
                        pIn = DTHandles.PositionHandle2D(GUIUtility.GetControlID(FocusType.Passive), pIn, r, 1);
                    }
                    chgIn         = Target.HandleInPosition != pIn;
                    Handles.color = Color.green;
                    pOut          = Target.HandleOutPosition;
                    pOut          = DTHandles.TinyHandle2D(GUIUtility.GetControlID(FocusType.Passive), pOut, r, CurvyGlobalManager.GizmoControlPointSize * 0.7f, Handles.CubeCap);
                    if (!CurvyProject.Instance.UseTiny2DHandles)
                    {
                        pOut = DTHandles.PositionHandle2D(GUIUtility.GetControlID(FocusType.Passive), pOut, r, 1);
                    }

                    chgOut = Target.HandleOutPosition != pOut;
                }
                else
                {
                    pIn   = Handles.PositionHandle(Target.HandleInPosition, Tools.handleRotation);
                    chgIn = Target.HandleInPosition != pIn;
                    DTHandles.PushHandlesColor(Color.yellow);
                    Handles.CubeCap(0, pIn, Quaternion.identity, HandleUtility.GetHandleSize(pIn) * CurvyGlobalManager.GizmoControlPointSize * 0.7f);
                    DTHandles.PopHandlesColor();
                    pOut   = Handles.PositionHandle(Target.HandleOutPosition, Tools.handleRotation);
                    chgOut = Target.HandleOutPosition != pOut;
                    DTHandles.PushHandlesColor(Color.green);
                    Handles.CubeCap(0, pOut, Quaternion.identity, HandleUtility.GetHandleSize(pOut) * CurvyGlobalManager.GizmoControlPointSize * 0.7f);
                    DTHandles.PopHandlesColor();
                }

                Handles.color = Color.yellow;
                Handles.DrawLine(pIn, Target.transform.position);
                Handles.color = Color.green;
                Handles.DrawLine(pOut, Target.transform.position);


                if (chgOut || chgIn)
                {
                    Undo.RecordObject(Target, "Move Handle");
                    if (chgOut)
                    {
                        Target.SetBezierHandleOut(pOut, Space.World, CurvyProject.Instance.BezierMode);
                        Target.HandleOut = DTMath.SnapPrecision(Target.HandleOut, 3);
                    }
                    else
                    {
                        Target.SetBezierHandleIn(pIn, Space.World, CurvyProject.Instance.BezierMode);
                        Target.HandleIn = DTMath.SnapPrecision(Target.HandleIn, 3);
                    }
                }

                if (EditorGUI.EndChangeCheck())
                {
                    EditorUtility.SetDirty(Target);
                    Target.SetDirty();

                    /*
                     * var lcons = CurvyProject.Instance.FindItem<TBCPLengthConstraint>();
                     * if (lcons.On && Target.Spline.Length > lcons.MaxSplineLength)
                     * {
                     *  Target.HandleOutPosition = handleOut;
                     *  Target.HandleInPosition = handleIn;
                     *  Target.SetDirty();
                     * }
                     */
                }
                #endregion
            }
            if (mConnectionEditor)
            {
                mConnectionEditor.OnSceneGUI();
            }
            // Snap Transform
            if (Target && DT._UseSnapValuePrecision)
            {
                Target.transform.localPosition    = DTMath.SnapPrecision(Target.transform.localPosition, 3);
                Target.transform.localEulerAngles = DTMath.SnapPrecision(Target.transform.localEulerAngles, 3);
                //Target.TTransform.FromTransform(Target.transform);
            }
        }
Ejemplo n.º 14
0
        void OnRenderTab(DTInspectorNode node)
        {
            int grpIdx = node.Index - 2;

            if (grpIdx >= 0 && grpIdx < Target.GroupCount)
            {
                var pGroup = serializedObject.FindProperty(string.Format("m_Groups.Array.data[{0}]", grpIdx));
                if (pGroup != null)
                {
                    var group  = Target.Groups[grpIdx];
                    var pItems = pGroup.FindPropertyRelative("m_Items");
                    if (pItems != null)
                    {
                        if (mCurrentGroup != null && mCurrentGroup != group)
                        {
                            mGroupItemsList = null;
                        }
                        if (mGroupItemsList == null)
                        {
                            mCurrentGroup                       = group;
                            mGroupItemsList                     = new ReorderableList(pItems.serializedObject, pItems);
                            mGroupItemsList.draggable           = true;
                            mGroupItemsList.drawHeaderCallback  = (Rect Rect) => { EditorGUI.LabelField(Rect, "Items"); };
                            mGroupItemsList.drawElementCallback = (Rect rect, int index, bool isActive, bool isFocused) =>
                            {
                                #region ---
                                bool fix = (index <group.FirstRepeating || index> group.LastRepeating);

                                if (fix)
                                {
                                    DTHandles.DrawSolidRectangleWithOutline(rect.ShiftBy(0, -1), new Color(0, 0, 0.5f, 0.2f), new Color(0, 0, 0, 0));
                                }

                                var prop   = pItems.FindPropertyRelative(string.Format("Array.data[{0}]", index));
                                var pIndex = prop.FindPropertyRelative("Index");

                                rect.height = EditorGUIUtility.singleLineHeight;
                                var r = new Rect(rect);
                                EditorGUI.LabelField(new Rect(rect.x, rect.y, 30, rect.height), "#" + index.ToString() + ":");
                                r.x    += 30;
                                r.width = rect.width / 2 - 50;
                                var bn = Target.BoundsNames;
                                var bi = Target.BoundsIndices;
                                if (bn.Length == 0)
                                {
                                    pIndex.intValue = EditorGUI.IntField(r, "", pIndex.intValue);
                                }
                                else
                                {
                                    EditorGUI.IntPopup(r, pIndex, bn, bi, new GUIContent(""));
                                }

                                r.x    += r.width + 10;
                                r.width = rect.width / 2;
                                if (!fix && group.RepeatingOrder == CurvyRepeatingOrderEnum.Random)
                                {
                                    EditorGUI.PropertyField(r, prop.FindPropertyRelative("m_Weight"), new GUIContent(""));
                                }
                                #endregion
                            };

                            mGroupItemsList.onAddCallback = (ReorderableList l) =>
                            {
                                group.Items.Insert(Mathf.Clamp(l.index + 1, 0, group.ItemCount), new CGBoundsGroupItem());
                                group.LastRepeating++;
                                Target.Dirty = true;
                                EditorUtility.SetDirty(Target);
                            };
                            mGroupItemsList.onRemoveCallback = (ReorderableList l) =>
                            {
                                group.Items.RemoveAt(l.index);
                                group.LastRepeating--;
                                Target.Dirty = true;
                                EditorUtility.SetDirty(Target);
                            };
                        }

                        mGroupItemsList.DoLayoutList();

                        EditorGUILayout.PropertyField(pGroup.FindPropertyRelative("m_RepeatingItems"));
                        EditorGUILayout.PropertyField(pGroup.FindPropertyRelative("m_RepeatingOrder"));
                        EditorGUILayout.PropertyField(pGroup.FindPropertyRelative("m_KeepTogether"));
                        EditorGUILayout.PropertyField(pGroup.FindPropertyRelative("m_SpaceBefore"));
                        EditorGUILayout.PropertyField(pGroup.FindPropertyRelative("m_SpaceAfter"));
                        EditorGUILayout.PropertyField(pGroup.FindPropertyRelative("m_DistributionMode"), new GUIContent("Mode"));
                        EditorGUILayout.PropertyField(pGroup.FindPropertyRelative("m_PositionOffset"));
                        EditorGUILayout.PropertyField(pGroup.FindPropertyRelative("m_Height"));
                        EditorGUILayout.PropertyField(pGroup.FindPropertyRelative("m_RotationMode"));
                        EditorGUILayout.PropertyField(pGroup.FindPropertyRelative("m_RotationOffset"));
                        EditorGUILayout.PropertyField(pGroup.FindPropertyRelative("m_RotationScatter"));
                    }
                }
            }
        }