Пример #1
0
        protected override object DrawInternal(Rect rect)
        {
            if (hideGroup)
            {
                DrawChildren(ref rect);
                if (drawAddButton)
                {
                    DrawArrayAddButton(rect);
                }
            }
            else
            {
                using (var foldout = new FoldoutBlock(this, rect, new GUIContent(fieldName)))
                {
                    rect.y += ReflectionDrawerStyles.singleLineHeight;
                    if (foldout.isUnFolded)
                    {
                        using (var indent = new IndentBlock(rect))
                        {
                            DrawChildren(ref indent.rect);
                            if (drawAddButton)
                            {
                                DrawArrayAddButton(indent.rect);
                            }
                        }
                    }
                }
            }

            return(value);
        }
Пример #2
0
        protected virtual void DrawChildren(Rect rect)
        {
            if (hideGroup)
            {
                foreach (var child in children)
                {
                    child.Draw(ref rect);
                }
            }
            else
            {
                var       r2        = rect;
                const int r2Padding = 15;
                r2.width = EditorGUIUtility.labelWidth - r2Padding;
                r2.x    += r2Padding;

                EditorGUI.LabelField(r2, GetFoldoutName());
                using (var foldout = new FoldoutBlock(this, new Rect(rect.x, rect.y, rect.width, ReflectionDrawerStyles.singleLineHeight), GUIContent.none))
                {
                    rect.y += ReflectionDrawerStyles.singleLineHeight;

                    if (foldout.isUnFolded)
                    {
                        using (var indent = new IndentBlock(rect))
                        {
                            foreach (var child in children)
                            {
                                child.Draw(ref indent.rect);
                            }
                        }
                    }
                }
            }
        }
Пример #3
0
 public BaseGUI()
 {
     stateBlock        = new StateBlock();
     colorBlock        = new GUIColorBlock();
     labelWidthBlock   = new LabelWidthBlock();
     contentColorBlock = new ContentColorBlock();
     indentBlock       = new IndentBlock(this);
     ScrollView        = new ScrollViewBlock(this);
 }
Пример #4
0
 public BaseGUI()
 {
     stateBlock = new StateBlock();
     colorBlock = new GUIColorBlock();
     labelWidthBlock = new LabelWidthBlock();
     contentColorBlock = new ContentColorBlock();
     indentBlock = new IndentBlock(this);
     ScrollView = new ScrollViewBlock(this);
 }