public static void CreateAndSetTreeView(ObjectTreeForSelector.TreeSelectorData data)
 {
     AudioMixerController objectFromInstanceID = InternalEditorUtility.GetObjectFromInstanceID(data.userData) as AudioMixerController;
     TreeViewController treeView = new TreeViewController(data.editorWindow, data.state);
     GroupTreeViewGUI gui = new GroupTreeViewGUI(treeView);
     TreeViewDataSourceForMixers mixers = new TreeViewDataSourceForMixers(treeView, objectFromInstanceID);
     mixers.onVisibleRowsChanged = (Action) Delegate.Combine(mixers.onVisibleRowsChanged, new Action(gui, (IntPtr) this.CalculateRowRects));
     treeView.deselectOnUnhandledMouseDown = false;
     treeView.Init(data.treeViewRect, mixers, gui, null);
     data.objectTreeForSelector.SetTreeView(treeView);
 }
        public static void CreateAndSetTreeView(ObjectTreeForSelector.TreeSelectorData data)
        {
            AudioMixerController        objectFromInstanceID = InternalEditorUtility.GetObjectFromInstanceID(data.userData) as AudioMixerController;
            TreeViewController          treeView             = new TreeViewController(data.editorWindow, data.state);
            GroupTreeViewGUI            gui    = new GroupTreeViewGUI(treeView);
            TreeViewDataSourceForMixers mixers = new TreeViewDataSourceForMixers(treeView, objectFromInstanceID);

            mixers.onVisibleRowsChanged           = (System.Action)Delegate.Combine(mixers.onVisibleRowsChanged, new System.Action(gui.CalculateRowRects));
            treeView.deselectOnUnhandledMouseDown = false;
            treeView.Init(data.treeViewRect, mixers, gui, null);
            data.objectTreeForSelector.SetTreeView(treeView);
        }
예제 #3
0
        public static void CreateAndSetTreeView(ObjectTreeForSelector.TreeSelectorData data)
        {
            var ignoreController = InternalEditorUtility.GetObjectFromInstanceID(data.userData) as AudioMixerController;

            // Create treeview
            var treeView   = new TreeViewController(data.editorWindow, data.state);
            var treeGui    = new GroupTreeViewGUI(treeView);
            var dataSource = new TreeViewDataSourceForMixers(treeView, ignoreController);

            dataSource.onVisibleRowsChanged      += treeGui.CalculateRowRects;
            treeView.deselectOnUnhandledMouseDown = false;
            treeView.Init(data.treeViewRect, dataSource, treeGui, null);

            // Set
            data.objectTreeForSelector.SetTreeView(treeView);
        }
예제 #4
0
        private void InitTreeView(Rect rect)
        {
            TreeViewDataSourceForMixers mixers;

            this.m_TreeViewState = new TreeViewState();
            this.m_TreeView      = new TreeView(base.editorWindow, this.m_TreeViewState);
            GroupTreeViewGUI gui = new GroupTreeViewGUI(this.m_TreeView);

            mixers = new TreeViewDataSourceForMixers(this.m_TreeView, this.m_IgnoreThisController)
            {
                onVisibleRowsChanged = (System.Action)Delegate.Combine(mixers.onVisibleRowsChanged, new System.Action(gui.CalculateRowRects)),
                onVisibleRowsChanged = (System.Action)Delegate.Combine(mixers.onVisibleRowsChanged, new System.Action(this.ResizeWindow))
            };
            this.m_TreeView.deselectOnUnhandledMouseDown = true;
            this.m_TreeView.Init(rect, mixers, gui, null);
            this.m_TreeView.ReloadData();
            this.m_TreeView.selectionChangedCallback  = new Action <int[]>(this.OnItemSelectionChanged);
            this.m_TreeView.itemDoubleClickedCallback = new Action <int>(this.OnItemDoubleClicked);
            int[] selectedIDs = new int[] { (this.m_OriginalSelection == null) ? 0 : this.m_OriginalSelection.GetInstanceID() };
            this.m_TreeView.SetSelection(selectedIDs, true);
        }
예제 #5
0
        private AudioMixerGroupController GetGroupByID(int id)
        {
            TreeViewDataSourceForMixers data = this.m_TreeView.data as TreeViewDataSourceForMixers;

            return(data.GetGroup(id));
        }
 private void InitTreeView(Rect rect)
 {
     TreeViewDataSourceForMixers mixers;
     this.m_TreeViewState = new TreeViewState();
     this.m_TreeView = new TreeView(base.editorWindow, this.m_TreeViewState);
     GroupTreeViewGUI gui = new GroupTreeViewGUI(this.m_TreeView);
     mixers = new TreeViewDataSourceForMixers(this.m_TreeView, this.m_IgnoreThisController) {
         onVisibleRowsChanged = (System.Action) Delegate.Combine(mixers.onVisibleRowsChanged, new System.Action(gui.CalculateRowRects)),
         onVisibleRowsChanged = (System.Action) Delegate.Combine(mixers.onVisibleRowsChanged, new System.Action(this.ResizeWindow))
     };
     this.m_TreeView.deselectOnUnhandledMouseDown = true;
     this.m_TreeView.Init(rect, mixers, gui, null);
     this.m_TreeView.ReloadData();
     this.m_TreeView.selectionChangedCallback = new Action<int[]>(this.OnItemSelectionChanged);
     this.m_TreeView.itemDoubleClickedCallback = new Action<int>(this.OnItemDoubleClicked);
     int[] selectedIDs = new int[] { (this.m_OriginalSelection == null) ? 0 : this.m_OriginalSelection.GetInstanceID() };
     this.m_TreeView.SetSelection(selectedIDs, true);
 }