Inheritance: TreeViewDataSource
 public AudioMixerGroupTreeView(AudioMixerWindow mixerWindow, TreeViewState treeState)
 {
     this.m_AudioGroupTreeState = treeState;
     this.m_AudioGroupTree      = new TreeView(mixerWindow, this.m_AudioGroupTreeState);
     this.m_AudioGroupTree.deselectOnUnhandledMouseDown = false;
     this.m_AudioGroupTree.selectionChangedCallback     = (Action <int[]>)Delegate.Combine(this.m_AudioGroupTree.selectionChangedCallback, new Action <int[]>(this.OnTreeSelectionChanged));
     this.m_AudioGroupTree.contextClickItemCallback     = (Action <int>)Delegate.Combine(this.m_AudioGroupTree.contextClickItemCallback, new Action <int>(this.OnTreeViewContextClick));
     this.m_AudioGroupTree.expandedStateChanged         = (System.Action)Delegate.Combine(this.m_AudioGroupTree.expandedStateChanged, new System.Action(this.SaveExpandedState));
     this.m_TreeViewGUI = new AudioGroupTreeViewGUI(this.m_AudioGroupTree);
     this.m_TreeViewGUI.NodeWasToggled = (Action <AudioMixerTreeViewNode, bool>)Delegate.Combine(this.m_TreeViewGUI.NodeWasToggled, new Action <AudioMixerTreeViewNode, bool>(this.OnNodeToggled));
     this.m_AudioGroupTreeDataSource   = new AudioGroupDataSource(this.m_AudioGroupTree, this.m_Controller);
     this.m_AudioGroupTree.Init(mixerWindow.position, this.m_AudioGroupTreeDataSource, this.m_TreeViewGUI, new AudioGroupTreeViewDragging(this.m_AudioGroupTree, this));
     this.m_AudioGroupTree.ReloadData();
 }
 public AudioMixerGroupTreeView(AudioMixerWindow mixerWindow, TreeViewState treeState)
 {
     this.m_AudioGroupTreeState = treeState;
     this.m_AudioGroupTree = new TreeView(mixerWindow, this.m_AudioGroupTreeState);
     this.m_AudioGroupTree.deselectOnUnhandledMouseDown = false;
     this.m_AudioGroupTree.selectionChangedCallback = (Action<int[]>) Delegate.Combine(this.m_AudioGroupTree.selectionChangedCallback, new Action<int[]>(this.OnTreeSelectionChanged));
     this.m_AudioGroupTree.contextClickItemCallback = (Action<int>) Delegate.Combine(this.m_AudioGroupTree.contextClickItemCallback, new Action<int>(this.OnTreeViewContextClick));
     this.m_AudioGroupTree.expandedStateChanged = (System.Action) Delegate.Combine(this.m_AudioGroupTree.expandedStateChanged, new System.Action(this.SaveExpandedState));
     this.m_TreeViewGUI = new AudioGroupTreeViewGUI(this.m_AudioGroupTree);
     this.m_TreeViewGUI.NodeWasToggled = (Action<AudioMixerTreeViewNode, bool>) Delegate.Combine(this.m_TreeViewGUI.NodeWasToggled, new Action<AudioMixerTreeViewNode, bool>(this.OnNodeToggled));
     this.m_AudioGroupTreeDataSource = new AudioGroupDataSource(this.m_AudioGroupTree, this.m_Controller);
     this.m_AudioGroupTree.Init(mixerWindow.position, this.m_AudioGroupTreeDataSource, this.m_TreeViewGUI, new AudioGroupTreeViewDragging(this.m_AudioGroupTree, this));
     this.m_AudioGroupTree.ReloadData();
 }
        private void AddNodesRecursively(AudioMixerGroupController group, TreeViewItem parent, int depth)
        {
            List <TreeViewItem> list = new List <TreeViewItem>();

            for (int i = 0; i < group.children.Length; i++)
            {
                int uniqueNodeID = AudioGroupDataSource.GetUniqueNodeID(group.children[i]);
                AudioMixerTreeViewNode audioMixerTreeViewNode = new AudioMixerTreeViewNode(uniqueNodeID, depth, parent, group.children[i].name, group.children[i]);
                audioMixerTreeViewNode.parent = parent;
                list.Add(audioMixerTreeViewNode);
                this.AddNodesRecursively(group.children[i], audioMixerTreeViewNode, depth + 1);
            }
            parent.children = list;
        }
 public override void FetchData()
 {
     if ((Object)this.m_Controller == (Object)null)
     {
         this.m_RootItem = (TreeViewItem)null;
     }
     else if ((Object)this.m_Controller.masterGroup == (Object)null)
     {
         Debug.LogError((object)"The Master group is missing !!!");
         this.m_RootItem = (TreeViewItem)null;
     }
     else
     {
         this.m_RootItem = (TreeViewItem) new AudioMixerTreeViewNode(AudioGroupDataSource.GetUniqueNodeID(this.m_Controller.masterGroup), 0, (TreeViewItem)null, this.m_Controller.masterGroup.name, this.m_Controller.masterGroup);
         this.AddNodesRecursively(this.m_Controller.masterGroup, this.m_RootItem, 1);
         this.m_NeedRefreshVisibleFolders = true;
     }
 }
        public override void FetchData()
        {
            if (this.m_Controller == null)
            {
                this.m_RootItem = null;
                return;
            }
            if (this.m_Controller.masterGroup == null)
            {
                Debug.LogError("The Master group is missing !!!");
                this.m_RootItem = null;
                return;
            }
            int uniqueNodeID = AudioGroupDataSource.GetUniqueNodeID(this.m_Controller.masterGroup);

            this.m_RootItem = new AudioMixerTreeViewNode(uniqueNodeID, 0, null, this.m_Controller.masterGroup.name, this.m_Controller.masterGroup);
            this.AddNodesRecursively(this.m_Controller.masterGroup, this.m_RootItem, 1);
            this.m_NeedRefreshVisibleFolders = true;
        }
Beispiel #6
0
        public AudioMixerGroupTreeView(AudioMixerWindow mixerWindow, TreeViewState treeState)
        {
            m_AudioGroupTreeState = treeState;

            m_AudioGroupTree = new TreeViewController(mixerWindow, m_AudioGroupTreeState);
            m_AudioGroupTree.deselectOnUnhandledMouseDown = false;
            m_AudioGroupTree.selectionChangedCallback    += OnTreeSelectionChanged;
            m_AudioGroupTree.contextClickItemCallback    += OnTreeViewContextClick;
            m_AudioGroupTree.expandedStateChanged        += SaveExpandedState;

            m_TreeViewGUI = new AudioGroupTreeViewGUI(m_AudioGroupTree);
            m_TreeViewGUI.NodeWasToggled += OnNodeToggled;

            m_AudioGroupTreeDataSource = new AudioGroupDataSource(m_AudioGroupTree, m_Controller);
            m_AudioGroupTree.Init(mixerWindow.position,
                                  m_AudioGroupTreeDataSource, m_TreeViewGUI,
                                  new AudioGroupTreeViewDragging(m_AudioGroupTree, this)
                                  );
            m_AudioGroupTree.ReloadData();
        }
        private void AddNodesRecursively(AudioMixerGroupController group, TreeViewItem parent, int depth)
        {
            List <TreeViewItem> treeViewItemList = new List <TreeViewItem>();

            for (int index = 0; index < group.children.Length; ++index)
            {
                AudioMixerTreeViewNode mixerTreeViewNode = new AudioMixerTreeViewNode(AudioGroupDataSource.GetUniqueNodeID(group.children[index]), depth, parent, group.children[index].name, group.children[index]);
                mixerTreeViewNode.parent = parent;
                treeViewItemList.Add((TreeViewItem)mixerTreeViewNode);
                this.AddNodesRecursively(group.children[index], (TreeViewItem)mixerTreeViewNode, depth + 1);
            }
            parent.children = treeViewItemList;
        }