Exemplo n.º 1
0
        public void Add(TreeEntry child)
        {
            if (Children == null)
            {
                Children = new List <TreeEntry>();
            }

            child.Parent = this;
            Children.Add(child);
            Sort();
        }
Exemplo n.º 2
0
        protected void DrawParent(TreeEntry listEntry)
        {
            if (listEntry.Children == null || !listEntry.Children.Any(o => o.Enabled))
            {
                return;
            }

            listEntry.Expanded = EditorGUILayout.Foldout(listEntry.Expanded, listEntry.ToString(), true);

            if (listEntry.Expanded)
            {
                using (new EditorGUILayout.HorizontalScope()) {
                    GUILayout.Space(10);

                    using (new EditorGUILayout.VerticalScope()) {
                        DrawEntries(new List <ListEntry>(listEntry.Children));
                    }
                }
            }
        }