public void DuplicateGroups(List <AudioMixerGroupController> groups, bool recordUndo)
        {
            if (recordUndo)
            {
                Undo.RecordObject(this.m_Controller, "Duplicate group" + AudioMixerGroupTreeView.PluralIfNeeded(groups.Count));
            }
            List <AudioMixerGroupController> list = this.m_Controller.DuplicateGroups(groups.ToArray());

            if (list.Count > 0)
            {
                this.ReloadTree();
                int[] array = (from audioMixerGroup in list
                               select audioMixerGroup.GetInstanceID()).ToArray <int>();
                this.m_AudioGroupTree.SetSelection(array, false);
                this.m_AudioGroupTree.Frame(array[array.Length - 1], true, false);
            }
        }
 public void DeleteGroups(List <AudioMixerGroupController> groups, bool recordUndo)
 {
     foreach (AudioMixerGroupController current in groups)
     {
         if (current.HasDependentMixers())
         {
             if (!EditorUtility.DisplayDialog("Referenced Group", "Deleted group is referenced by another AudioMixer, are you sure?", "Delete", "Cancel"))
             {
                 return;
             }
             break;
         }
     }
     if (recordUndo)
     {
         Undo.RegisterCompleteObjectUndo(this.m_Controller, "Delete Group" + AudioMixerGroupTreeView.PluralIfNeeded(groups.Count));
     }
     this.m_Controller.DeleteGroups(groups.ToArray());
     this.ReloadTree();
 }
Exemple #3
0
        public void DuplicateGroups(List <AudioMixerGroupController> groups, bool recordUndo)
        {
            if (recordUndo)
            {
                Undo.RecordObject((UnityEngine.Object) this.m_Controller, "Duplicate group" + AudioMixerGroupTreeView.PluralIfNeeded(groups.Count));
            }
            List <AudioMixerGroupController> source = this.m_Controller.DuplicateGroups(groups.ToArray());

            if (source.Count <= 0)
            {
                return;
            }
            this.ReloadTree();
            int[] array = source.Select <AudioMixerGroupController, int>((Func <AudioMixerGroupController, int>)(audioMixerGroup => audioMixerGroup.GetInstanceID())).ToArray <int>();
            this.m_AudioGroupTree.SetSelection(array, false);
            this.m_AudioGroupTree.Frame(array[array.Length - 1], true, false);
        }
Exemple #4
0
 public void DeleteGroups(List <AudioMixerGroupController> groups, bool recordUndo)
 {
     using (List <AudioMixerGroupController> .Enumerator enumerator = groups.GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             if (enumerator.Current.HasDependentMixers())
             {
                 if (!EditorUtility.DisplayDialog("Referenced Group", "Deleted group is referenced by another AudioMixer, are you sure?", "Delete", "Cancel"))
                 {
                     return;
                 }
                 break;
             }
         }
     }
     if (recordUndo)
     {
         Undo.RegisterCompleteObjectUndo((UnityEngine.Object) this.m_Controller, "Delete Group" + AudioMixerGroupTreeView.PluralIfNeeded(groups.Count));
     }
     this.m_Controller.DeleteGroups(groups.ToArray());
     this.ReloadTree();
 }