Inheritance: EditorWindow, IHasCustomMenu
Exemple #1
0
 private void UpdateAfterAssetChange()
 {
     if (!(this.m_Controller == null))
     {
         this.m_AllControllers = AudioMixerWindow.FindAllAudioMixerControllers();
         this.m_Controller.SanitizeGroupViews();
         this.m_Controller.OnUnitySelectionChanged();
         if (this.m_GroupTree != null)
         {
             this.m_GroupTree.ReloadTreeData();
         }
         if (this.m_GroupViews != null)
         {
             this.m_GroupViews.RecreateListControl();
         }
         if (this.m_SnapshotListView != null)
         {
             this.m_SnapshotListView.LoadFromBackend();
         }
         if (this.m_MixersTree != null)
         {
             this.m_MixersTree.ReloadTree();
         }
         AudioMixerUtility.RepaintAudioMixerAndInspectors();
     }
 }
Exemple #2
0
 public void OnEnable()
 {
     AudioMixerWindow.s_Instance            = this;
     Undo.undoRedoPerformed                 = (Undo.UndoRedoCallback)Delegate.Combine(Undo.undoRedoPerformed, new Undo.UndoRedoCallback(this.UndoRedoPerformed));
     EditorApplication.playmodeStateChanged = (EditorApplication.CallbackFunction)Delegate.Combine(EditorApplication.playmodeStateChanged, new EditorApplication.CallbackFunction(this.PlaymodeChanged));
     EditorApplication.projectWindowChanged = (EditorApplication.CallbackFunction)Delegate.Combine(EditorApplication.projectWindowChanged, new EditorApplication.CallbackFunction(this.OnProjectChanged));
 }
Exemple #3
0
 public void OnEnable()
 {
     this.titleContent                       = this.GetLocalizedTitleContent();
     AudioMixerWindow.s_Instance             = this;
     Undo.undoRedoPerformed                 += new Undo.UndoRedoCallback(this.UndoRedoPerformed);
     EditorApplication.playmodeStateChanged += new EditorApplication.CallbackFunction(this.PlaymodeChanged);
     EditorApplication.projectWindowChanged += new EditorApplication.CallbackFunction(this.OnProjectChanged);
 }
 private void OnProjectChanged()
 {
     if (this.m_MixersTree == null)
     {
         this.Init();
     }
     this.m_AllControllers = AudioMixerWindow.FindAllAudioMixerControllers();
     this.m_MixersTree.ReloadTree();
 }
 public void Awake()
 {
     this.m_AllControllers = AudioMixerWindow.FindAllAudioMixerControllers();
     if (this.m_MixersTreeState != null)
     {
         this.m_MixersTreeState.OnAwake();
         this.m_MixersTreeState.selectedIDs = new List <int>();
     }
 }
        private void UpdateViews()
        {
            AudioMixerWindow editorWindowOfType = (AudioMixerWindow)WindowLayout.FindEditorWindowOfType(typeof(AudioMixerWindow));

            if ((UnityEngine.Object)editorWindowOfType != (UnityEngine.Object)null)
            {
                editorWindowOfType.Repaint();
            }
            InspectorWindow.RepaintAllInspectors();
        }
Exemple #7
0
        private void UpdateViews()
        {
            AudioMixerWindow audioMixerWindow = (AudioMixerWindow)WindowLayout.FindEditorWindowOfType(typeof(AudioMixerWindow));

            if (audioMixerWindow != null)
            {
                audioMixerWindow.Repaint();
            }
            InspectorWindow.RepaintAllInspectors();
        }
 public AudioMixersTreeView(AudioMixerWindow mixerWindow, TreeViewState treeState, Func<List<AudioMixerController>> getAllControllersCallback)
 {
     this.m_TreeView = new TreeViewController(mixerWindow, treeState);
     this.m_TreeView.deselectOnUnhandledMouseDown = false;
     this.m_TreeView.selectionChangedCallback = (Action<int[]>) Delegate.Combine(this.m_TreeView.selectionChangedCallback, new Action<int[]>(this.OnTreeSelectionChanged));
     this.m_TreeView.contextClickItemCallback = (Action<int>) Delegate.Combine(this.m_TreeView.contextClickItemCallback, new Action<int>(this.OnTreeViewContextClick));
     AudioMixersTreeViewGUI gui = new AudioMixersTreeViewGUI(this.m_TreeView);
     AudioMixersDataSource data = new AudioMixersDataSource(this.m_TreeView, getAllControllersCallback);
     AudioMixerTreeViewDragging dragging = new AudioMixerTreeViewDragging(this.m_TreeView, new Action<List<AudioMixerController>, AudioMixerController>(this, (IntPtr) this.OnMixersDroppedOnMixerCallback));
     this.m_TreeView.Init(mixerWindow.position, data, gui, dragging);
     this.m_TreeView.ReloadData();
 }
        public static void Create()
        {
            AudioMixerWindow window = EditorWindow.GetWindow <AudioMixerWindow>(new Type[]
            {
                typeof(ProjectBrowser)
            });

            if (window.m_Pos.width < 400f)
            {
                window.m_Pos = new Rect(window.m_Pos.x, window.m_Pos.y, 800f, 450f);
            }
        }
Exemple #10
0
        public static void Create()
        {
            AudioMixerWindow window = EditorWindow.GetWindow <AudioMixerWindow>(new System.Type[1] {
                typeof(ProjectBrowser)
            });

            if ((double)window.m_Pos.width >= 400.0)
            {
                return;
            }
            window.m_Pos = new Rect(window.m_Pos.x, window.m_Pos.y, 800f, 450f);
        }
 public AudioMixersTreeView(AudioMixerWindow mixerWindow, TreeViewState treeState, Func<List<AudioMixerController>> getAllControllersCallback)
 {
   this.m_TreeView = new TreeView((EditorWindow) mixerWindow, treeState);
   this.m_TreeView.deselectOnUnhandledMouseDown = false;
   this.m_TreeView.selectionChangedCallback += new System.Action<int[]>(this.OnTreeSelectionChanged);
   this.m_TreeView.contextClickItemCallback += new System.Action<int>(this.OnTreeViewContextClick);
   AudioMixersTreeViewGUI mixersTreeViewGui = new AudioMixersTreeViewGUI(this.m_TreeView);
   AudioMixersDataSource mixersDataSource = new AudioMixersDataSource(this.m_TreeView, getAllControllersCallback);
   AudioMixerTreeViewDragging treeViewDragging = new AudioMixerTreeViewDragging(this.m_TreeView, new System.Action<List<AudioMixerController>, AudioMixerController>(this.OnMixersDroppedOnMixerCallback));
   this.m_TreeView.Init(mixerWindow.position, (ITreeViewDataSource) mixersDataSource, (ITreeViewGUI) mixersTreeViewGui, (ITreeViewDragging) treeViewDragging);
   this.m_TreeView.ReloadData();
 }
Exemple #12
0
 public void OnEnable()
 {
     if (this.m_LayoutMode == AudioMixerWindow.LayoutMode.Uninitialized)
     {
         this.m_LayoutMode = ((!EditorPrefs.GetBool(AudioMixerWindow.kAudioMixerUseHorzLayout)) ? AudioMixerWindow.LayoutMode.Vertical : AudioMixerWindow.LayoutMode.Horizontal);
     }
     base.titleContent                       = base.GetLocalizedTitleContent();
     AudioMixerWindow.s_Instance             = this;
     Undo.undoRedoPerformed                  = (Undo.UndoRedoCallback)Delegate.Combine(Undo.undoRedoPerformed, new Undo.UndoRedoCallback(this.UndoRedoPerformed));
     EditorApplication.pauseStateChanged    += new Action <PauseState>(this.OnPauseStateChanged);
     EditorApplication.playModeStateChanged += new Action <PlayModeStateChange>(this.OnPlayModeStateChanged);
     EditorApplication.projectChanged       += new Action(this.OnProjectChanged);
 }
Exemple #13
0
        public AudioMixersTreeView(AudioMixerWindow mixerWindow, TreeViewState treeState, Func <List <AudioMixerController> > getAllControllersCallback)
        {
            this.m_TreeView = new TreeViewController(mixerWindow, treeState);
            this.m_TreeView.deselectOnUnhandledMouseDown = false;
            this.m_TreeView.selectionChangedCallback     = (Action <int[]>)Delegate.Combine(this.m_TreeView.selectionChangedCallback, new Action <int[]>(this.OnTreeSelectionChanged));
            this.m_TreeView.contextClickItemCallback     = (Action <int>)Delegate.Combine(this.m_TreeView.contextClickItemCallback, new Action <int>(this.OnTreeViewContextClick));
            AudioMixersTreeViewGUI     gui      = new AudioMixersTreeViewGUI(this.m_TreeView);
            AudioMixersDataSource      data     = new AudioMixersDataSource(this.m_TreeView, getAllControllersCallback);
            AudioMixerTreeViewDragging dragging = new AudioMixerTreeViewDragging(this.m_TreeView, new Action <List <AudioMixerController>, AudioMixerController>(this.OnMixersDroppedOnMixerCallback));

            this.m_TreeView.Init(mixerWindow.position, data, gui, dragging);
            this.m_TreeView.ReloadData();
        }
Exemple #14
0
        public AudioMixersTreeView(AudioMixerWindow mixerWindow, TreeViewState treeState, Func <List <AudioMixerController> > getAllControllersCallback)
        {
            this.m_TreeView = new TreeView((EditorWindow)mixerWindow, treeState);
            this.m_TreeView.deselectOnUnhandledMouseDown = false;
            this.m_TreeView.selectionChangedCallback    += new System.Action <int[]>(this.OnTreeSelectionChanged);
            this.m_TreeView.contextClickItemCallback    += new System.Action <int>(this.OnTreeViewContextClick);
            AudioMixersTreeViewGUI     mixersTreeViewGui = new AudioMixersTreeViewGUI(this.m_TreeView);
            AudioMixersDataSource      mixersDataSource  = new AudioMixersDataSource(this.m_TreeView, getAllControllersCallback);
            AudioMixerTreeViewDragging treeViewDragging  = new AudioMixerTreeViewDragging(this.m_TreeView, new System.Action <List <AudioMixerController>, AudioMixerController>(this.OnMixersDroppedOnMixerCallback));

            this.m_TreeView.Init(mixerWindow.position, (ITreeViewDataSource)mixersDataSource, (ITreeViewGUI)mixersTreeViewGui, (ITreeViewDragging)treeViewDragging);
            this.m_TreeView.ReloadData();
        }
        public AudioMixersTreeView(AudioMixerWindow mixerWindow, TreeViewState treeState, Func <List <AudioMixerController> > getAllControllersCallback)
        {
            m_TreeView = new TreeViewController(mixerWindow, treeState);
            m_TreeView.deselectOnUnhandledMouseDown = false;
            m_TreeView.selectionChangedCallback    += OnTreeSelectionChanged;
            m_TreeView.contextClickItemCallback    += OnTreeViewContextClick;

            var treeViewGUI        = new AudioMixersTreeViewGUI(m_TreeView);
            var treeViewDataSource = new AudioMixersDataSource(m_TreeView, getAllControllersCallback);
            var treeViewDragging   = new AudioMixerTreeViewDragging(m_TreeView, OnMixersDroppedOnMixerCallback);

            m_TreeView.Init(mixerWindow.position, treeViewDataSource, treeViewGUI, treeViewDragging);
            m_TreeView.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();
 }
 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 void OnEnable()
        {
            if (m_LayoutMode == LayoutMode.Uninitialized)
            {
                // We use vertical layout as default as it is the most compact layout
                m_LayoutMode = EditorPrefs.GetBool(kAudioMixerUseHorzLayout) ? LayoutMode.Horizontal : LayoutMode.Vertical;
            }
            titleContent = GetLocalizedTitleContent();

            s_Instance = this;

            Undo.undoRedoEvent += UndoRedoPerformed;
            EditorApplication.pauseStateChanged    += OnPauseStateChanged;
            EditorApplication.playModeStateChanged += OnPlayModeStateChanged;
        }
Exemple #19
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();
        }
 public void OnEnable()
 {
   this.titleContent = this.GetLocalizedTitleContent();
   AudioMixerWindow.s_Instance = this;
   Undo.undoRedoPerformed += new Undo.UndoRedoCallback(this.UndoRedoPerformed);
   EditorApplication.playmodeStateChanged += new EditorApplication.CallbackFunction(this.PlaymodeChanged);
   EditorApplication.projectWindowChanged += new EditorApplication.CallbackFunction(this.OnProjectChanged);
 }
		private float GetHeightOfSection(AudioMixerWindow.SectionType sectionType)
		{
			switch (sectionType)
			{
			case AudioMixerWindow.SectionType.MixerTree:
				return this.m_MixersTree.GetTotalHeight();
			case AudioMixerWindow.SectionType.GroupTree:
				return this.m_GroupTree.GetTotalHeight();
			case AudioMixerWindow.SectionType.ViewList:
				return this.m_GroupViews.GetTotalHeight();
			case AudioMixerWindow.SectionType.SnapshotList:
				return this.m_SnapshotListView.GetTotalHeight();
			default:
				Debug.LogError("Unhandled enum value");
				return 0f;
			}
		}
		public void OnEnable()
		{
			AudioMixerWindow.s_Instance = this;
			Undo.undoRedoPerformed = (Undo.UndoRedoCallback)Delegate.Combine(Undo.undoRedoPerformed, new Undo.UndoRedoCallback(this.UndoRedoPerformed));
			EditorApplication.playmodeStateChanged = (EditorApplication.CallbackFunction)Delegate.Combine(EditorApplication.playmodeStateChanged, new EditorApplication.CallbackFunction(this.PlaymodeChanged));
			EditorApplication.projectWindowChanged = (EditorApplication.CallbackFunction)Delegate.Combine(EditorApplication.projectWindowChanged, new EditorApplication.CallbackFunction(this.OnProjectChanged));
		}
Exemple #23
0
 public static void RepaintAudioMixerAndInspectors()
 {
     InspectorWindow.RepaintAllInspectors();
     AudioMixerWindow.RepaintAudioMixerWindow();
 }
 static void ShowAudioMixer()
 {
     AudioMixerWindow.CreateAudioMixerWindow();
 }
		private void DoSections(Rect totalRectOfSections, Rect[] sectionRects, AudioMixerWindow.SectionType[] sectionOrder)
		{
			Event current = Event.current;
			bool flag = this.m_Controller == null || AudioMixerController.EditingTargetSnapshot();
			for (int i = 0; i < sectionOrder.Length; i++)
			{
				Rect rect = sectionRects[i];
				if (rect.height > 0f)
				{
					switch (sectionOrder[i])
					{
					case AudioMixerWindow.SectionType.MixerTree:
						this.m_MixersTree.OnGUI(rect);
						break;
					case AudioMixerWindow.SectionType.GroupTree:
						this.m_GroupTree.OnGUI(rect);
						break;
					case AudioMixerWindow.SectionType.ViewList:
						this.m_GroupViews.OnGUI(rect);
						break;
					case AudioMixerWindow.SectionType.SnapshotList:
						EditorGUI.BeginDisabledGroup(!flag);
						this.m_SnapshotListView.OnGUI(rect);
						EditorGUI.EndDisabledGroup();
						break;
					default:
						Debug.LogError("Unhandled enum value");
						break;
					}
					if (current.type == EventType.ContextClick)
					{
						Rect rect2 = new Rect(rect.x, rect.y, rect.width - 15f, 22f);
						if (rect2.Contains(current.mousePosition))
						{
							this.ReorderContextMenu(rect2, i);
							current.Use();
						}
					}
				}
			}
		}
 private void DoSections(Rect totalRectOfSections, Rect[] sectionRects, AudioMixerWindow.SectionType[] sectionOrder)
 {
   Event current = Event.current;
   bool flag = (UnityEngine.Object) this.m_Controller == (UnityEngine.Object) null || AudioMixerController.EditingTargetSnapshot();
   for (int sectionIndex = 0; sectionIndex < sectionOrder.Length; ++sectionIndex)
   {
     Rect sectionRect = sectionRects[sectionIndex];
     if ((double) sectionRect.height > 0.0)
     {
       switch (sectionOrder[sectionIndex])
       {
         case AudioMixerWindow.SectionType.MixerTree:
           this.m_MixersTree.OnGUI(sectionRect);
           break;
         case AudioMixerWindow.SectionType.GroupTree:
           this.m_GroupTree.OnGUI(sectionRect);
           break;
         case AudioMixerWindow.SectionType.ViewList:
           this.m_GroupViews.OnGUI(sectionRect);
           break;
         case AudioMixerWindow.SectionType.SnapshotList:
           EditorGUI.BeginDisabledGroup(!flag);
           this.m_SnapshotListView.OnGUI(sectionRect);
           EditorGUI.EndDisabledGroup();
           break;
         default:
           Debug.LogError((object) "Unhandled enum value");
           break;
       }
       if (current.type == EventType.ContextClick)
       {
         Rect rect = new Rect(sectionRect.x, sectionRect.y, sectionRect.width - 15f, 22f);
         if (rect.Contains(current.mousePosition))
         {
           this.ReorderContextMenu(rect, sectionIndex);
           current.Use();
         }
       }
     }
   }
 }
Exemple #27
0
 private static void ShowAudioMixer()
 {
     AudioMixerWindow.Create();
 }