Beispiel #1
0
        public bool BeginFoldout(bool foldout, string label, int indentLevel, bool drawLine, ColorValue lineColor)
        {
            var backgroundColor = GUI.backgroundColor;
            var contentColor    = GUI.contentColor;

            GUI.backgroundColor = foldout ? backgroundColor : MightyColorUtilities.DarkenColor(backgroundColor, .3f);
            GUI.contentColor    = foldout ? contentColor : MightyColorUtilities.DarkenColor(contentColor, .25f);

            GUILayout.BeginVertical(MightyStyleUtilities.GetFoldAreaHeader(indentLevel));
            EditorGUI.indentLevel = 1;

            GUILayout.BeginVertical(MightyStyles.FoldBoxHeaderContent);
            foldout = MightyGUIUtilities.DrawFoldout(foldout, label, MightyStyles.FoldAreaLabel);
            GUILayout.EndVertical();

            if (!foldout)
            {
                EditorGUI.indentLevel = indentLevel;
                GUILayout.EndVertical();
            }
            else if (drawLine)
            {
                DrawLine(lineColor);
            }

            GUI.backgroundColor = backgroundColor;
            GUI.contentColor    = contentColor;

            return(foldout);
        }
Beispiel #2
0
        protected virtual void BeginGroup(BaseMightyMember mightyMember, T attribute)
        {
            if (!m_colorsCache.Contains(mightyMember))
            {
                EnableDrawer(mightyMember, attribute);
            }
            var(background, content) = m_colorsCache[mightyMember];

            MightyColorUtilities.BeginBackgroundColor(background.Value);
            MightyColorUtilities.BeginContentColor(content.Value);

            var indent  = IndentLevelForMember(mightyMember);
            var groupID = mightyMember.GroupID;

            BeginDrawGroup(indent, groupID);

            if (attribute.DrawName)
            {
                DrawGroupLabel(mightyMember.GroupName);
            }
            if (attribute.DrawLine)
            {
                DrawLine(attribute.LineColor);
            }

            BeginDrawContent(indent, groupID);
        }
Beispiel #3
0
 private static void EndBox()
 {
     Space();
     GUILayout.EndVertical();
     Space();
     GUILayout.EndHorizontal();
     m_darkBox.EndDrawGroup();
     MightyColorUtilities.EndBackgroundColor();
 }
Beispiel #4
0
        private static void BeginBox()
        {
            MightyColorUtilities.BeginBackgroundColor(ColorValue.SoftContrast.GetColor());
            m_darkBox.BeginDrawGroup(indentInside: false);

            GUILayout.BeginHorizontal();
            Space();

            GUILayout.BeginVertical();
        }
Beispiel #5
0
        protected virtual void EndGroup(BaseMightyMember mightyMember, T attribute)
        {
            var indent = IndentLevelForMember(mightyMember);

            EndDrawContent(indent);
            EndDrawGroup(indent);

            MightyColorUtilities.EndBackgroundColor();
            MightyColorUtilities.EndContentColor();
        }
Beispiel #6
0
        private static void BeginBox(string label)
        {
            MightyColorUtilities.BeginBackgroundColor(ColorValue.SoftContrast.GetColor());
            m_darkBox.BeginDrawGroup(indentInside: false);

            GUILayout.BeginHorizontal();
            Space();

            GUILayout.BeginVertical();
            m_darkBox.DrawGroupLabel(label, EditorStyles.boldLabel);
            m_darkBox.DrawLine();
        }