private void LoadExpandedState()
 {
     int[] intArray = SessionState.GetIntArray(AudioMixerGroupTreeView.GetUniqueAudioMixerName(this.m_Controller), null);
     if (intArray != null)
     {
         this.m_AudioGroupTreeState.expandedIDs = new List <int>(intArray);
     }
     else
     {
         this.m_AudioGroupTree.state.expandedIDs = new List <int>();
         this.m_AudioGroupTree.data.SetExpandedWithChildren(this.m_AudioGroupTree.data.root, true);
     }
 }
        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();
 }
Ejemplo n.º 4
0
 public AudioGroupTreeViewDragging(TreeViewController treeView, AudioMixerGroupTreeView owner)
     : base(treeView)
 {
     m_owner = owner;
 }
 private void SaveExpandedState()
 {
     SessionState.SetIntArray(AudioMixerGroupTreeView.GetUniqueAudioMixerName(this.m_Controller), this.m_AudioGroupTreeState.expandedIDs.ToArray());
 }
        private void DuplicateGroupPopupCallback(object obj)
        {
            AudioMixerGroupTreeView audioMixerGroupTreeView = (AudioMixerGroupTreeView)obj;

            audioMixerGroupTreeView.DuplicateGroups(this.GetGroupSelectionWithoutMasterGroup(), true);
        }
Ejemplo n.º 7
0
 private void Init()
 {
     if (!this.m_Initialized)
     {
         if (this.m_LayoutStripsOnTop == null)
         {
             this.m_LayoutStripsOnTop = new AudioMixerWindow.Layout();
         }
         if (this.m_LayoutStripsOnTop.m_VerticalSplitter == null || this.m_LayoutStripsOnTop.m_VerticalSplitter.realSizes.Length != 2)
         {
             this.m_LayoutStripsOnTop.m_VerticalSplitter = new SplitterState(new int[]
             {
                 65,
                 35
             }, new int[]
             {
                 85,
                 105
             }, null);
         }
         if (this.m_LayoutStripsOnTop.m_HorizontalSplitter == null || this.m_LayoutStripsOnTop.m_HorizontalSplitter.realSizes.Length != 4)
         {
             this.m_LayoutStripsOnTop.m_HorizontalSplitter = new SplitterState(new int[]
             {
                 60,
                 60,
                 60,
                 60
             }, new int[]
             {
                 85,
                 85,
                 85,
                 85
             }, null);
         }
         if (this.m_LayoutStripsOnRight == null)
         {
             this.m_LayoutStripsOnRight = new AudioMixerWindow.Layout();
         }
         if (this.m_LayoutStripsOnRight.m_HorizontalSplitter == null || this.m_LayoutStripsOnRight.m_HorizontalSplitter.realSizes.Length != 2)
         {
             this.m_LayoutStripsOnRight.m_HorizontalSplitter = new SplitterState(new int[]
             {
                 30,
                 70
             }, new int[]
             {
                 160,
                 160
             }, null);
         }
         if (this.m_LayoutStripsOnRight.m_VerticalSplitter == null || this.m_LayoutStripsOnRight.m_VerticalSplitter.realSizes.Length != 4)
         {
             this.m_LayoutStripsOnRight.m_VerticalSplitter = new SplitterState(new int[]
             {
                 60,
                 60,
                 60,
                 60
             }, new int[]
             {
                 100,
                 85,
                 85,
                 85
             }, null);
         }
         if (this.m_AudioGroupTreeState == null)
         {
             this.m_AudioGroupTreeState = new TreeViewState();
         }
         this.m_GroupTree = new AudioMixerGroupTreeView(this, this.m_AudioGroupTreeState);
         if (this.m_MixersTreeState == null)
         {
             this.m_MixersTreeState = new TreeViewStateWithAssetUtility();
         }
         this.m_MixersTree = new AudioMixersTreeView(this, this.m_MixersTreeState, new Func <List <AudioMixerController> >(this.GetAllControllers));
         if (this.m_ViewsState == null)
         {
             this.m_ViewsState = new ReorderableListWithRenameAndScrollView.State();
         }
         this.m_GroupViews = new AudioMixerGroupViewList(this.m_ViewsState);
         if (this.m_SnapshotState == null)
         {
             this.m_SnapshotState = new ReorderableListWithRenameAndScrollView.State();
         }
         this.m_SnapshotListView = new AudioMixerSnapshotListView(this.m_SnapshotState);
         if (this.m_ChannelStripViewState == null)
         {
             this.m_ChannelStripViewState = new AudioMixerChannelStripView.State();
         }
         this.m_ChannelStripView = new AudioMixerChannelStripView(this.m_ChannelStripViewState);
         this.OnMixerControllerChanged();
         this.m_Initialized = true;
     }
 }
Ejemplo n.º 8
0
 public AudioGroupTreeViewDragging(TreeView treeView, AudioMixerGroupTreeView owner)
     : base(treeView)
 {
     this.m_owner = owner;
 }
 public AudioGroupTreeViewDragging(TreeView treeView, AudioMixerGroupTreeView owner) : base(treeView)
 {
     this.m_owner = owner;
 }
Ejemplo n.º 10
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);
        }
Ejemplo n.º 11
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();
 }
Ejemplo n.º 12
0
		private void Init()
		{
			if (this.m_Initialized)
			{
				return;
			}
			if (this.m_LayoutStripsOnTop == null)
			{
				this.m_LayoutStripsOnTop = new AudioMixerWindow.Layout();
			}
			if (this.m_LayoutStripsOnTop.m_VerticalSplitter == null || this.m_LayoutStripsOnTop.m_VerticalSplitter.realSizes.Length != 2)
			{
				this.m_LayoutStripsOnTop.m_VerticalSplitter = new SplitterState(new int[]
				{
					65,
					35
				}, new int[]
				{
					85,
					105
				}, null);
			}
			if (this.m_LayoutStripsOnTop.m_HorizontalSplitter == null || this.m_LayoutStripsOnTop.m_HorizontalSplitter.realSizes.Length != 4)
			{
				this.m_LayoutStripsOnTop.m_HorizontalSplitter = new SplitterState(new int[]
				{
					60,
					60,
					60,
					60
				}, new int[]
				{
					85,
					85,
					85,
					85
				}, null);
			}
			if (this.m_LayoutStripsOnRight == null)
			{
				this.m_LayoutStripsOnRight = new AudioMixerWindow.Layout();
			}
			if (this.m_LayoutStripsOnRight.m_HorizontalSplitter == null || this.m_LayoutStripsOnRight.m_HorizontalSplitter.realSizes.Length != 2)
			{
				this.m_LayoutStripsOnRight.m_HorizontalSplitter = new SplitterState(new int[]
				{
					30,
					70
				}, new int[]
				{
					160,
					160
				}, null);
			}
			if (this.m_LayoutStripsOnRight.m_VerticalSplitter == null || this.m_LayoutStripsOnRight.m_VerticalSplitter.realSizes.Length != 4)
			{
				this.m_LayoutStripsOnRight.m_VerticalSplitter = new SplitterState(new int[]
				{
					60,
					60,
					60,
					60
				}, new int[]
				{
					100,
					85,
					85,
					85
				}, null);
			}
			if (this.m_AudioGroupTreeState == null)
			{
				this.m_AudioGroupTreeState = new TreeViewState();
			}
			this.m_GroupTree = new AudioMixerGroupTreeView(this, this.m_AudioGroupTreeState);
			if (this.m_MixersTreeState == null)
			{
				this.m_MixersTreeState = new TreeViewState();
			}
			this.m_MixersTree = new AudioMixersTreeView(this, this.m_MixersTreeState, new Func<List<AudioMixerController>>(this.GetAllControllers));
			if (this.m_ViewsState == null)
			{
				this.m_ViewsState = new ReorderableListWithRenameAndScrollView.State();
			}
			this.m_GroupViews = new AudioMixerGroupViewList(this.m_ViewsState);
			if (this.m_SnapshotState == null)
			{
				this.m_SnapshotState = new ReorderableListWithRenameAndScrollView.State();
			}
			this.m_SnapshotListView = new AudioMixerSnapshotListView(this.m_SnapshotState);
			if (this.m_ChannelStripViewState == null)
			{
				this.m_ChannelStripViewState = new AudioMixerChannelStripView.State();
			}
			this.m_ChannelStripView = new AudioMixerChannelStripView(this.m_ChannelStripViewState);
			this.OnMixerControllerChanged();
			this.m_Initialized = true;
		}
Ejemplo n.º 13
0
        void Init()
        {
            if (m_Initialized)
            {
                return;
            }

            if (m_LayoutStripsOnTop == null)
            {
                m_LayoutStripsOnTop = new Layout();
            }

            if (m_LayoutStripsOnTop.m_VerticalSplitter == null || m_LayoutStripsOnTop.m_VerticalSplitter.realSizes.Length != 2)
            {
                m_LayoutStripsOnTop.m_VerticalSplitter = SplitterState.FromAbsolute(new float[] { 65, 35 }, new float[] { 85, 105 }, null);
            }

            if (m_LayoutStripsOnTop.m_HorizontalSplitter == null || m_LayoutStripsOnTop.m_HorizontalSplitter.realSizes.Length != 4)
            {
                m_LayoutStripsOnTop.m_HorizontalSplitter = SplitterState.FromAbsolute(new float[] { 60, 60, 60, 60 }, new float[] { 85, 85, 85, 85 }, null);
            }

            if (m_LayoutStripsOnRight == null)
            {
                m_LayoutStripsOnRight = new Layout();
            }

            if (m_LayoutStripsOnRight.m_HorizontalSplitter == null || m_LayoutStripsOnRight.m_HorizontalSplitter.realSizes.Length != 2)
            {
                m_LayoutStripsOnRight.m_HorizontalSplitter = SplitterState.FromAbsolute(new float[] { 30, 70 }, new float[] { 160, 160 }, null);
            }

            if (m_LayoutStripsOnRight.m_VerticalSplitter == null || m_LayoutStripsOnRight.m_VerticalSplitter.realSizes.Length != 4)
            {
                m_LayoutStripsOnRight.m_VerticalSplitter = SplitterState.FromAbsolute(new float[] { 60, 60, 60, 60 }, new float[] { 100, 85, 85, 85 }, null);
            }

            if (m_AudioGroupTreeState == null)
            {
                m_AudioGroupTreeState = new TreeViewState();
            }
            m_GroupTree = new AudioMixerGroupTreeView(this, m_AudioGroupTreeState);

            if (m_MixersTreeState == null)
            {
                m_MixersTreeState = new TreeViewStateWithAssetUtility();
            }
            m_MixersTree = new AudioMixersTreeView(this, m_MixersTreeState, GetAllControllers);

            if (m_ViewsState == null)
            {
                m_ViewsState = new ReorderableListWithRenameAndScrollView.State();
            }
            m_GroupViews = new AudioMixerGroupViewList(m_ViewsState);

            if (m_SnapshotState == null)
            {
                m_SnapshotState = new ReorderableListWithRenameAndScrollView.State();
            }
            m_SnapshotListView = new AudioMixerSnapshotListView(m_SnapshotState);

            if (m_ChannelStripViewState == null)
            {
                m_ChannelStripViewState = new AudioMixerChannelStripView.State();
            }
            m_ChannelStripView = new AudioMixerChannelStripView(m_ChannelStripViewState);

            OnMixerControllerChanged();

            m_Initialized = true;
        }