Beispiel #1
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);
 }
 public virtual void AddItemsToMenu(GenericMenu menu)
 {
     menu.AddItem(new GUIContent("Sort groups alphabetically"), this.m_SortGroupsAlphabetically, delegate
     {
         this.m_SortGroupsAlphabetically = !this.m_SortGroupsAlphabetically;
     });
     menu.AddItem(new GUIContent("Show referenced groups"), this.m_ShowReferencedBuses, delegate
     {
         this.m_ShowReferencedBuses = !this.m_ShowReferencedBuses;
     });
     menu.AddItem(new GUIContent("Show group connections"), this.m_ShowBusConnections, delegate
     {
         this.m_ShowBusConnections = !this.m_ShowBusConnections;
     });
     if (this.m_ShowBusConnections)
     {
         menu.AddItem(new GUIContent("Only highlight selected group connections"), this.m_ShowBusConnectionsOfSelection, delegate
         {
             this.m_ShowBusConnectionsOfSelection = !this.m_ShowBusConnectionsOfSelection;
         });
     }
     menu.AddSeparator("");
     menu.AddItem(new GUIContent("Vertical layout"), this.layoutMode == AudioMixerWindow.LayoutMode.Vertical, delegate
     {
         this.layoutMode = AudioMixerWindow.LayoutMode.Vertical;
     });
     menu.AddItem(new GUIContent("Horizontal layout"), this.layoutMode == AudioMixerWindow.LayoutMode.Horizontal, delegate
     {
         this.layoutMode = AudioMixerWindow.LayoutMode.Horizontal;
     });
     menu.AddSeparator("");
     menu.AddItem(new GUIContent("Use RMS metering for display"), EditorPrefs.GetBool(AudioMixerWindow.kAudioMixerUseRMSMetering, true), delegate
     {
         EditorPrefs.SetBool(AudioMixerWindow.kAudioMixerUseRMSMetering, true);
     });
     menu.AddItem(new GUIContent("Use peak metering for display"), !EditorPrefs.GetBool(AudioMixerWindow.kAudioMixerUseRMSMetering, true), delegate
     {
         EditorPrefs.SetBool(AudioMixerWindow.kAudioMixerUseRMSMetering, false);
     });
     if (Unsupported.IsDeveloperBuild())
     {
         menu.AddSeparator("");
         menu.AddItem(new GUIContent("DEVELOPER/Groups Rendered Above"), this.m_GroupsRenderedAboveSections, delegate
         {
             this.m_GroupsRenderedAboveSections = !this.m_GroupsRenderedAboveSections;
         });
         menu.AddItem(new GUIContent("DEVELOPER/Build 10 groups"), false, delegate
         {
             this.m_Controller.BuildTestSetup(0, 7, 10);
         });
         menu.AddItem(new GUIContent("DEVELOPER/Build 20 groups"), false, delegate
         {
             this.m_Controller.BuildTestSetup(0, 7, 20);
         });
         menu.AddItem(new GUIContent("DEVELOPER/Build 40 groups"), false, delegate
         {
             this.m_Controller.BuildTestSetup(0, 7, 40);
         });
         menu.AddItem(new GUIContent("DEVELOPER/Build 80 groups"), false, delegate
         {
             this.m_Controller.BuildTestSetup(0, 7, 80);
         });
         menu.AddItem(new GUIContent("DEVELOPER/Build 160 groups"), false, delegate
         {
             this.m_Controller.BuildTestSetup(0, 7, 160);
         });
         menu.AddItem(new GUIContent("DEVELOPER/Build chain of 10 groups"), false, delegate
         {
             this.m_Controller.BuildTestSetup(1, 1, 10);
         });
         menu.AddItem(new GUIContent("DEVELOPER/Build chain of 20 groups "), false, delegate
         {
             this.m_Controller.BuildTestSetup(1, 1, 20);
         });
         menu.AddItem(new GUIContent("DEVELOPER/Build chain of 40 groups"), false, delegate
         {
             this.m_Controller.BuildTestSetup(1, 1, 40);
         });
         menu.AddItem(new GUIContent("DEVELOPER/Build chain of 80 groups"), false, delegate
         {
             this.m_Controller.BuildTestSetup(1, 1, 80);
         });
         menu.AddItem(new GUIContent("DEVELOPER/Show overlays"), this.m_ShowDeveloperOverlays, delegate
         {
             this.m_ShowDeveloperOverlays = !this.m_ShowDeveloperOverlays;
         });
     }
 }
		public virtual void AddItemsToMenu(GenericMenu menu)
		{
			menu.AddItem(new GUIContent("Sort groups alphabetically"), this.m_SortGroupsAlphabetically, delegate
			{
				this.m_SortGroupsAlphabetically = !this.m_SortGroupsAlphabetically;
			});
			menu.AddItem(new GUIContent("Show referenced buses"), this.m_ShowReferencedBuses, delegate
			{
				this.m_ShowReferencedBuses = !this.m_ShowReferencedBuses;
			});
			menu.AddItem(new GUIContent("Show bus connections"), this.m_ShowBusConnections, delegate
			{
				this.m_ShowBusConnections = !this.m_ShowBusConnections;
			});
			if (this.m_ShowBusConnections)
			{
				menu.AddItem(new GUIContent("Highlight bus connections of selection"), this.m_ShowBusConnectionsOfSelection, delegate
				{
					this.m_ShowBusConnectionsOfSelection = !this.m_ShowBusConnectionsOfSelection;
				});
			}
			menu.AddSeparator(string.Empty);
			menu.AddItem(new GUIContent("Vertical layout"), this.layoutMode == AudioMixerWindow.LayoutMode.Vertical, delegate
			{
				this.layoutMode = AudioMixerWindow.LayoutMode.Vertical;
			});
			menu.AddItem(new GUIContent("Horizontal layout"), this.layoutMode == AudioMixerWindow.LayoutMode.Horizontal, delegate
			{
				this.layoutMode = AudioMixerWindow.LayoutMode.Horizontal;
			});
			menu.AddSeparator(string.Empty);
			menu.AddItem(new GUIContent("Use RMS metering for display"), EditorPrefs.GetBool(AudioMixerWindow.kAudioMixerUseRMSMetering, true), delegate
			{
				EditorPrefs.SetBool(AudioMixerWindow.kAudioMixerUseRMSMetering, true);
			});
			menu.AddItem(new GUIContent("Use peak metering for display"), !EditorPrefs.GetBool(AudioMixerWindow.kAudioMixerUseRMSMetering, true), delegate
			{
				EditorPrefs.SetBool(AudioMixerWindow.kAudioMixerUseRMSMetering, false);
			});
			if (Unsupported.IsDeveloperBuild())
			{
				menu.AddSeparator(string.Empty);
				menu.AddItem(new GUIContent("DEVELOPER/Groups Rendered Above"), this.m_GroupsRenderedAboveSections, delegate
				{
					this.m_GroupsRenderedAboveSections = !this.m_GroupsRenderedAboveSections;
				});
				menu.AddItem(new GUIContent("DEVELOPER/Build 10 groups"), false, delegate
				{
					this.m_Controller.BuildTestSetup(0, 7, 10);
				});
				menu.AddItem(new GUIContent("DEVELOPER/Build 20 groups"), false, delegate
				{
					this.m_Controller.BuildTestSetup(0, 7, 20);
				});
				menu.AddItem(new GUIContent("DEVELOPER/Build 40 groups"), false, delegate
				{
					this.m_Controller.BuildTestSetup(0, 7, 40);
				});
				menu.AddItem(new GUIContent("DEVELOPER/Build 80 groups"), false, delegate
				{
					this.m_Controller.BuildTestSetup(0, 7, 80);
				});
				menu.AddItem(new GUIContent("DEVELOPER/Build 160 groups"), false, delegate
				{
					this.m_Controller.BuildTestSetup(0, 7, 160);
				});
				menu.AddItem(new GUIContent("DEVELOPER/Build chain of 10 groups"), false, delegate
				{
					this.m_Controller.BuildTestSetup(1, 1, 10);
				});
				menu.AddItem(new GUIContent("DEVELOPER/Build chain of 20 groups "), false, delegate
				{
					this.m_Controller.BuildTestSetup(1, 1, 20);
				});
				menu.AddItem(new GUIContent("DEVELOPER/Build chain of 40 groups"), false, delegate
				{
					this.m_Controller.BuildTestSetup(1, 1, 40);
				});
				menu.AddItem(new GUIContent("DEVELOPER/Build chain of 80 groups"), false, delegate
				{
					this.m_Controller.BuildTestSetup(1, 1, 80);
				});
				menu.AddItem(new GUIContent("DEVELOPER/Show overlays"), this.m_ShowDeveloperOverlays, delegate
				{
					this.m_ShowDeveloperOverlays = !this.m_ShowDeveloperOverlays;
				});
			}
		}