AddGroup() public méthode

public AddGroup ( TreeGroup parent, System type ) : TreeGroup
parent TreeGroup
type System
Résultat TreeGroup
        public void InspectorHierachy(TreeData treeData, Renderer renderer)
        {
            if (s_SelectedGroup == null)
            {
                Debug.Log("NO GROUP SELECTED!");
            }
            else
            {
                EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]);
                GUILayout.BeginVertical(new GUILayoutOption[0]);
                bool changed = GUI.changed;
                Rect sizeRect = this.GUIPropBegin();
                this.DrawHierachy(treeData, renderer, sizeRect);
                if (GUI.changed != changed)
                {
                    this.m_WantCompleteUpdate = true;
                }
                this.GUIPropEnd(false);
                this.GUIPropBegin();
                int num = -1;
                GUILayout.BeginHorizontal(styles.toolbar, new GUILayoutOption[0]);
                if (GUILayout.Button(styles.iconRefresh, styles.toolbarButton, new GUILayoutOption[0]))
                {
                    TreeGroupLeaf.s_TextureHullsDirty = true;
                    UpdateMesh(base.target as Tree);
                }
                GUILayout.FlexibleSpace();
                GUI.enabled = s_SelectedGroup.CanHaveSubGroups();
                if (GUILayout.Button(styles.iconAddLeaves, styles.toolbarButton, new GUILayoutOption[0]))
                {
                    num = 0;
                }
                if (GUILayout.Button(styles.iconAddBranches, styles.toolbarButton, new GUILayoutOption[0]))
                {
                    num = 1;
                }
                GUI.enabled = true;
                if (s_SelectedGroup == treeData.root)
                {
                    GUI.enabled = false;
                }
                if (GUILayout.Button(styles.iconDuplicate, styles.toolbarButton, new GUILayoutOption[0]))
                {
                    num = 3;
                }
                if (GUILayout.Button(styles.iconTrash, styles.toolbarButton, new GUILayoutOption[0]))
                {
                    num = 2;
                }
                GUI.enabled = true;
                GUILayout.EndHorizontal();
                switch (num)
                {
                    case 0:
                    {
                        this.UndoStoreSelected(EditMode.CreateGroup);
                        TreeGroup group = treeData.AddGroup(s_SelectedGroup, typeof(TreeGroupLeaf));
                        this.SelectGroup(group);
                        this.m_WantCompleteUpdate = true;
                        Event.current.Use();
                        break;
                    }
                    case 1:
                    {
                        this.UndoStoreSelected(EditMode.CreateGroup);
                        TreeGroup group2 = treeData.AddGroup(s_SelectedGroup, typeof(TreeGroupBranch));
                        this.SelectGroup(group2);
                        this.m_WantCompleteUpdate = true;
                        Event.current.Use();
                        break;
                    }
                    case 2:
                        this.DeleteSelected(treeData);
                        Event.current.Use();
                        break;

                    case 3:
                        this.DuplicateSelected(treeData);
                        Event.current.Use();
                        break;
                }
                this.GUIPropEnd(false);
                GUILayout.EndVertical();
                EditorGUILayout.EndHorizontal();
                EditorGUILayout.Space();
            }
        }