Example #1
0
        protected override void SetupArrayEx(DTFieldNode node, DevTools.ArrayExAttribute attribute)
        {
            switch (node.Name)
            {
            case "m_Groups":
                node.ArrayEx.drawHeaderCallback  = (Rect Rect) => { EditorGUI.LabelField(Rect, "Groups"); };
                node.ArrayEx.drawElementCallback = OnGroupElementGUI;
                node.ArrayEx.onAddCallback       = (ReorderableList l) =>
                {
                    Target.Groups.Insert(Mathf.Clamp(l.index + 1, 0, Target.GroupCount), new CGBoundsGroup("Group"));
                    Target.LastRepeating++;
                    EditorUtility.SetDirty(Target);
                    ensureGroupTabs();
                };
                node.ArrayEx.onRemoveCallback = (ReorderableList l) =>
                {
                    mGroupItemsList = null;
                    Target.Groups.RemoveAt(l.index);
                    Target.LastRepeating--;
                    EditorUtility.SetDirty(Target);

                    //node[1+l.index].Delete();
                    ensureGroupTabs();
                    GUIUtility.ExitGUI();
                };
                node.ArrayEx.onReorderCallback = (ReorderableList l) =>
                {
                    ensureGroupTabs();
                    GUIUtility.ExitGUI();
                };
                break;
            }
        }
Example #2
0
 protected override void SetupArrayEx(DTFieldNode node, DevTools.ArrayExAttribute attribute)
 {
     node.ArrayEx.drawElementCallback = onGameObjectGUI;
     node.ArrayEx.onSelectCallback    = (ReorderableList l) => { selectedIndex = l.index; };
     node.ArrayEx.onAddCallback       = (ReorderableList l) =>
     {
         Target.GameObjects.Insert(Mathf.Clamp(l.index + 1, 0, Target.GameObjects.Count), new CGGameObjectProperties());
         EditorUtility.SetDirty(Target);
     };
 }
 protected override void SetupArrayEx(DevToolsEditor.DTFieldNode node, DevTools.ArrayExAttribute attribute)
 {
     base.SetupArrayEx(node, attribute);
     node.ArrayEx.elementHeight      *= 4;
     node.ArrayEx.drawElementCallback = OnSpotGUI;
     node.ArrayEx.onSelectCallback    = (ReorderableList l) => { selectedIndex = l.index; };
     node.ArrayEx.onAddCallback       = (ReorderableList l) =>
     {
         CGSpot newSpot = (selectedIndex > -1 && selectedIndex < Target.Spots.Count) ? Target.Spots[selectedIndex] : new CGSpot(0, Vector3.zero, Quaternion.identity, Vector3.one);
         Target.Spots.Insert(Mathf.Max(0, l.index + 1), newSpot);
         EditorUtility.SetDirty(Target);
     };
 }
Example #4
0
 protected override void SetupArrayEx(DTFieldNode node, DevTools.ArrayExAttribute attribute)
 {
     node.ArrayEx.elementHeight       = 23;
     node.ArrayEx.drawElementCallback = drawSlot;
 }
 protected override void SetupArrayEx(DTFieldNode node, DevTools.ArrayExAttribute attribute)
 {
     mSplineList = node.ArrayEx;
     mSplineList.onChangedCallback = OnChanged;
 }