Example #1
0
        public static void Box(this HUMEditor.Data.Horizontal horizontal, Color backgroundColor, Color borderColor, RectOffset padding, RectOffset border, Action contents = null, params GUILayoutOption[] options)
        {
            var style       = new GUIStyle();
            var borderStyle = new GUIStyle();

            style.normal.background       = HUMTexture.Create(1, 1).Color(backgroundColor);
            borderStyle.normal.background = HUMTexture.Create(1, 1).Color(borderColor);
            borderStyle.padding           = border;
            style.padding = padding;

            HUMEditor.Horizontal(borderStyle, () =>
            {
                HUMEditor.Horizontal(style, () =>
                {
                    contents?.Invoke();
                });
            }, options);
        }
Example #2
0
        public static void Box(this HUMEditor.Data.Vertical vertical, Color backgroundColor, Color borderColor, RectOffset padding, TextAnchor contentAlignment, int border = 1, Action contents = null, params GUILayoutOption[] options)
        {
            var style       = new GUIStyle();
            var borderStyle = new GUIStyle();

            style.normal.background       = HUMTexture.Create(1, 1).Color(backgroundColor);
            borderStyle.normal.background = HUMTexture.Create(1, 1).Color(borderColor);
            borderStyle.padding           = new RectOffset(border, border, border, border);
            style.padding   = padding;
            style.alignment = contentAlignment;

            HUMEditor.Vertical(borderStyle, () =>
            {
                HUMEditor.Vertical(style, () =>
                {
                    contents?.Invoke();
                });
            }, options);
        }