Exemple #1
0
        protected virtual void RenderHeader(Rect headerRect, float headerWidth)
        {
            if (HeaderHeight == 0)
            {
                return;
            }

            if (Event.current.type == EventType.Repaint)
            {
                GUI.color = BackgroundColor;
                EditorGUI.DrawTextureAlpha(headerRect, EditorGUIUtility.whiteTexture);
                GUI.color = Color.white;
            }

            Rect foldoutRect = headerRect;

            foldoutRect.width = 16;

            GUI.backgroundColor = Color.white;
            EditorGUI.BeginChangeCheck();
            ShowEditorList = EditorGUI.Foldout(foldoutRect, ShowEditorList, string.Empty);
            if (EditorGUI.EndChangeCheck())
            {
                if (Event.current.shift)
                {
                    if (this is FContainerEditor)
                    {
                        ShowAllContainers(ShowEditorList);
                    }
                    else if (this is FTimelineEditor)
                    {
                        ShowAllTimelines(ShowEditorList);
                    }
                }
            }

            Rect labelRect = headerRect;

            labelRect.width = headerWidth;
            labelRect.xMin += 16;

            Rect iconRect = labelRect;

            if (_icon != null)
            {
                if (IconOnLeft)
                {
                    labelRect.xMin += IconSize;
                }
                else
                {
                    labelRect.xMax -= IconSize;
                    iconRect.xMin   = labelRect.xMax;
                }

                iconRect.width  = IconSize;
                iconRect.height = IconSize;

                GUI.color = FGUI.GetIconColor();
                GUI.DrawTexture(iconRect, _icon.image);
                GUI.color = Color.white;
            }

            GUI.contentColor = FGUI.GetTextColor();
            GUI.Label(labelRect, HeaderText, EditorStyles.boldLabel);

            OnHeaderInput(labelRect, iconRect);
        }
Exemple #2
0
 protected virtual Color GetPreviewIconColor()
 {
     return(FGUI.GetIconColor());
 }