public void AddAudioMixerGroup(AudioMixerGroupController parent)
 {
     if (!(parent == null) && !(this.m_Controller == null))
     {
         Undo.RecordObjects(new UnityEngine.Object[]
         {
             this.m_Controller,
             parent
         }, "Add Child Group");
         AudioMixerGroupController audioMixerGroupController = this.m_Controller.CreateNewGroup("New Group", true);
         this.m_Controller.AddChildToParent(audioMixerGroupController, parent);
         this.m_Controller.AddGroupToCurrentView(audioMixerGroupController);
         Selection.objects = new AudioMixerGroupController[]
         {
             audioMixerGroupController
         };
         this.m_Controller.OnUnitySelectionChanged();
         this.m_AudioGroupTree.SetSelection(new int[]
         {
             audioMixerGroupController.GetInstanceID()
         }, true);
         this.ReloadTree();
         this.m_AudioGroupTree.BeginNameEditing(0f);
     }
 }
Exemplo n.º 2
0
        public void AddAudioMixerGroup(AudioMixerGroupController parent)
        {
            if ((UnityEngine.Object)parent == (UnityEngine.Object)null || (UnityEngine.Object) this.m_Controller == (UnityEngine.Object)null)
            {
                return;
            }
            Undo.RecordObjects(new UnityEngine.Object[2]
            {
                (UnityEngine.Object) this.m_Controller,
                (UnityEngine.Object)parent
            }, "Add Child Group");
            AudioMixerGroupController newGroup = this.m_Controller.CreateNewGroup("New Group", true);

            this.m_Controller.AddChildToParent(newGroup, parent);
            this.m_Controller.AddGroupToCurrentView(newGroup);
            Selection.objects = (UnityEngine.Object[]) new AudioMixerGroupController[1]
            {
                newGroup
            };
            this.m_Controller.OnUnitySelectionChanged();
            this.m_AudioGroupTree.SetSelection(new int[1]
            {
                newGroup.GetInstanceID()
            }, 1 != 0);
            this.ReloadTree();
            this.m_AudioGroupTree.BeginNameEditing(0.0f);
        }
Exemplo n.º 3
0
            private TreeViewItem BuildSubTree(AudioMixerController controller)
            {
                AudioMixerGroupController masterGroup = controller.masterGroup;
                var masterItem = new MixerTreeViewItem(masterGroup.GetInstanceID(), 0, m_RootItem, masterGroup.name, masterGroup);

                AddChildrenRecursive(masterGroup, masterItem);
                return(masterItem);
            }
Exemplo n.º 4
0
            private TreeViewItem BuildSubTree(AudioMixerController controller)
            {
                AudioMixerGroupController masterGroup = controller.masterGroup;
                TreeViewItem treeViewItem             = new TreeViewItem(masterGroup.GetInstanceID(), 0, this.m_RootItem, masterGroup.name);

                treeViewItem.userData = masterGroup;
                this.AddChildrenRecursive(masterGroup, treeViewItem);
                return(treeViewItem);
            }
 public void AddAudioMixerGroup(AudioMixerGroupController parent)
 {
     if ((parent != null) && (this.m_Controller != null))
     {
         UnityEngine.Object[] objectsToUndo = new UnityEngine.Object[] { this.m_Controller, parent };
         Undo.RecordObjects(objectsToUndo, "Add Child Group");
         AudioMixerGroupController child = this.m_Controller.CreateNewGroup("New Group", true);
         this.m_Controller.AddChildToParent(child, parent);
         this.m_Controller.AddGroupToCurrentView(child);
         AudioMixerGroupController[] controllerArray1 = new AudioMixerGroupController[] { child };
         Selection.objects = controllerArray1;
         this.m_Controller.OnUnitySelectionChanged();
         int[] selectedIDs = new int[] { child.GetInstanceID() };
         this.m_AudioGroupTree.SetSelection(selectedIDs, true);
         this.ReloadTree();
         this.m_AudioGroupTree.BeginNameEditing(0f);
     }
 }
Exemplo n.º 6
0
 static public int GetUniqueNodeID(AudioMixerGroupController group)
 {
     return(group.GetInstanceID()); // alternative: group.groupID.GetHashCode();
 }
Exemplo n.º 7
0
 public void Visitor(AudioMixerGroupController group)
 {
     this.instanceIDs.Add(group.GetInstanceID());
 }
Exemplo n.º 8
0
 public static int GetUniqueNodeID(AudioMixerGroupController group)
 {
     return(group.GetInstanceID());
 }
Exemplo n.º 9
0
            private TreeViewItem BuildSubTree(AudioMixerController controller)
            {
                AudioMixerGroupController masterGroup = controller.masterGroup;

                TreeViewForAudioMixerGroup.MixerTreeViewItem mixerTreeViewItem = new TreeViewForAudioMixerGroup.MixerTreeViewItem(masterGroup.GetInstanceID(), 0, this.m_RootItem, masterGroup.name, masterGroup);
                this.AddChildrenRecursive(masterGroup, mixerTreeViewItem);
                return(mixerTreeViewItem);
            }
 public static int GetUniqueNodeID(AudioMixerGroupController group) =>
 group.GetInstanceID();