Ejemplo n.º 1
0
        public void Show(Transform transform)
        {
            if (treeView != null && rootTransform == transform)
            {
                Refresh();
                return;
            }

            if (treeViewState == null || rootTransform != transform)
            {
                treeViewState = new TreeViewState();
            }

            treeView = new CustomHierarchyWindowDrawer(treeViewState, transform)
            {
                OnSelectionChanged = (newSelection) =>
                {
                    if (OnSelectionChanged != null)
                    {
                        OnSelectionChanged(newSelection);
                    }
                }
            };

            searchField = new SearchField();
            searchField.downOrUpArrowKeyPressed += treeView.SetFocusAndEnsureSelectedItem;

            createButtonContent = new GUIContent("Create");
            rootTransform       = transform;
        }
Ejemplo n.º 2
0
 public SelectionChangeApplier(CustomHierarchyWindowDrawer hierarchy)
 {
     this.hierarchy = hierarchy;
     oldSelection   = Selection.gameObjects;
 }