UnityEditor.AudioMixerDrawUtils.HeaderLabel C# (CSharp) Method

HeaderLabel() public static method

public static HeaderLabel ( Rect r, GUIContent text, Texture2D icon ) : void
r UnityEngine.Rect
text UnityEngine.GUIContent
icon UnityEngine.Texture2D
return void
        public static void HeaderLabel(Rect r, GUIContent text, Texture2D icon)
        {
            if (icon != null)
            {
                EditorGUIUtility.SetIconSize(new Vector2(16f, 16f));
                GUI.Label(r, icon, styles.headerStyle);
                EditorGUIUtility.SetIconSize(Vector2.zero);
                r.xMin += 20f;
            }
            GUI.Label(r, text, styles.headerStyle);
        }

Usage Example

        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);
            }
        }
All Usage Examples Of UnityEditor.AudioMixerDrawUtils::HeaderLabel