コード例 #1
0
        public void OnGUI(Rect rect)
        {
            int controlID = GUIUtility.GetControlID(FocusType.Keyboard);

            this.m_ScrollToItem = null;
            if (AudioMixerGroupTreeView.s_Styles == null)
            {
                AudioMixerGroupTreeView.s_Styles = new AudioMixerGroupTreeView.Styles();
            }
            this.m_AudioGroupTree.OnEvent();
            Rect r;
            Rect rect2;

            using (new EditorGUI.DisabledScope(this.m_Controller == null))
            {
                AudioMixerDrawUtils.DrawRegionBg(rect, out r, out rect2);
                AudioMixerDrawUtils.HeaderLabel(r, AudioMixerGroupTreeView.s_Styles.header, AudioMixerGroupTreeView.s_Styles.audioMixerGroupIcon);
            }
            if (this.m_Controller != null)
            {
                AudioMixerGroupController parent = (this.m_Controller.CachedSelection.Count != 1) ? this.m_Controller.masterGroup : this.m_Controller.CachedSelection[0];
                using (new EditorGUI.DisabledScope(EditorApplication.isPlaying))
                {
                    if (GUI.Button(new Rect(r.xMax - 15f, r.y + 3f, 15f, 15f), AudioMixerGroupTreeView.s_Styles.addText, EditorStyles.label))
                    {
                        this.AddAudioMixerGroup(parent);
                    }
                }
                this.m_AudioGroupTree.OnGUI(rect2, controlID);
                AudioMixerDrawUtils.DrawScrollDropShadow(rect2, this.m_AudioGroupTree.state.scrollPos.y, this.m_AudioGroupTree.gui.GetTotalSize().y);
                this.HandleKeyboardEvents(controlID);
                this.HandleCommandEvents(controlID);
            }
        }
コード例 #2
0
        public void OnGUI(Rect rect)
        {
            int controlId = GUIUtility.GetControlID(FocusType.Keyboard);

            this.m_ScrollToItem = (AudioMixerGroupController)null;
            if (AudioMixerGroupTreeView.s_Styles == null)
            {
                AudioMixerGroupTreeView.s_Styles = new AudioMixerGroupTreeView.Styles();
            }
            this.m_AudioGroupTree.OnEvent();
            EditorGUI.BeginDisabledGroup((UnityEngine.Object) this.m_Controller == (UnityEngine.Object)null);
            Rect headerRect;
            Rect contentRect;

            AudioMixerDrawUtils.DrawRegionBg(rect, out headerRect, out contentRect);
            AudioMixerDrawUtils.HeaderLabel(headerRect, AudioMixerGroupTreeView.s_Styles.header, AudioMixerGroupTreeView.s_Styles.audioMixerGroupIcon);
            EditorGUI.EndDisabledGroup();
            if (!((UnityEngine.Object) this.m_Controller != (UnityEngine.Object)null))
            {
                return;
            }
            AudioMixerGroupController parent = this.m_Controller.CachedSelection.Count != 1 ? this.m_Controller.masterGroup : this.m_Controller.CachedSelection[0];

            EditorGUI.BeginDisabledGroup(EditorApplication.isPlaying);
            if (GUI.Button(new Rect(headerRect.xMax - 15f, headerRect.y + 3f, 15f, 15f), AudioMixerGroupTreeView.s_Styles.addText, EditorStyles.label))
            {
                this.AddAudioMixerGroup(parent);
            }
            EditorGUI.EndDisabledGroup();
            this.m_AudioGroupTree.OnGUI(contentRect, controlId);
            AudioMixerDrawUtils.DrawScrollDropShadow(contentRect, this.m_AudioGroupTree.state.scrollPos.y, this.m_AudioGroupTree.gui.GetTotalSize().y);
            this.HandleKeyboardEvents(controlId);
            this.HandleCommandEvents(controlId);
        }
コード例 #3
0
		public void OnGUI(Rect rect)
		{
			int controlID = GUIUtility.GetControlID(FocusType.Keyboard);
			this.m_ScrollToItem = null;
			if (AudioMixerGroupTreeView.s_Styles == null)
			{
				AudioMixerGroupTreeView.s_Styles = new AudioMixerGroupTreeView.Styles();
			}
			this.m_AudioGroupTree.OnEvent();
			EditorGUI.BeginDisabledGroup(this.m_Controller == null);
			Rect r;
			Rect rect2;
			AudioMixerDrawUtils.DrawRegionBg(rect, out r, out rect2);
			AudioMixerDrawUtils.HeaderLabel(r, AudioMixerGroupTreeView.s_Styles.header, AudioMixerGroupTreeView.s_Styles.audioMixerGroupIcon);
			EditorGUI.EndDisabledGroup();
			if (this.m_Controller != null)
			{
				AudioMixerGroupController parent = (this.m_Controller.CachedSelection.Count != 1) ? this.m_Controller.masterGroup : this.m_Controller.CachedSelection[0];
				EditorGUI.BeginDisabledGroup(EditorApplication.isPlaying);
				if (GUI.Button(new Rect(r.xMax - 15f, r.y + 3f, 15f, 15f), AudioMixerGroupTreeView.s_Styles.addText, EditorStyles.label))
				{
					this.AddAudioMixerGroup(parent);
				}
				EditorGUI.EndDisabledGroup();
				this.m_AudioGroupTree.OnGUI(rect2, controlID);
				AudioMixerDrawUtils.DrawScrollDropShadow(rect2, this.m_AudioGroupTree.state.scrollPos.y, this.m_AudioGroupTree.gui.GetTotalSize(this.m_AudioGroupTree.data.GetVisibleRows()).y);
				this.HandleKeyboardEvents(controlID);
				this.HandleCommandEvents(controlID);
			}
		}
コード例 #4
0
 public void OnGUI(Rect rect)
 {
   int controlId = GUIUtility.GetControlID(FocusType.Keyboard);
   this.m_ScrollToItem = (AudioMixerGroupController) null;
   if (AudioMixerGroupTreeView.s_Styles == null)
     AudioMixerGroupTreeView.s_Styles = new AudioMixerGroupTreeView.Styles();
   this.m_AudioGroupTree.OnEvent();
   EditorGUI.BeginDisabledGroup((UnityEngine.Object) this.m_Controller == (UnityEngine.Object) null);
   Rect headerRect;
   Rect contentRect;
   AudioMixerDrawUtils.DrawRegionBg(rect, out headerRect, out contentRect);
   AudioMixerDrawUtils.HeaderLabel(headerRect, AudioMixerGroupTreeView.s_Styles.header, AudioMixerGroupTreeView.s_Styles.audioMixerGroupIcon);
   EditorGUI.EndDisabledGroup();
   if (!((UnityEngine.Object) this.m_Controller != (UnityEngine.Object) null))
     return;
   AudioMixerGroupController parent = this.m_Controller.CachedSelection.Count != 1 ? this.m_Controller.masterGroup : this.m_Controller.CachedSelection[0];
   EditorGUI.BeginDisabledGroup(EditorApplication.isPlaying);
   if (GUI.Button(new Rect(headerRect.xMax - 15f, headerRect.y + 3f, 15f, 15f), AudioMixerGroupTreeView.s_Styles.addText, EditorStyles.label))
     this.AddAudioMixerGroup(parent);
   EditorGUI.EndDisabledGroup();
   this.m_AudioGroupTree.OnGUI(contentRect, controlId);
   AudioMixerDrawUtils.DrawScrollDropShadow(contentRect, this.m_AudioGroupTree.state.scrollPos.y, this.m_AudioGroupTree.gui.GetTotalSize().y);
   this.HandleKeyboardEvents(controlId);
   this.HandleCommandEvents(controlId);
 }