Ejemplo n.º 1
0
            protected override T DoEdit(Rect rect, T obj, TContext context, fiGraphMetadata metadata)
            {
                var indent = _indent.GetCurrentValue(obj, context);

                rect.x     += indent;
                rect.width -= indent;
                return(_control.Edit(rect, obj, context, metadata));
            }
            protected override T DoEdit(Rect rect, T obj, TContext context, fiGraphMetadata metadata)
            {
                fiLateBindings.fiEditorGUI.PushHierarchyMode(false);
                var result = _childControl.Edit(rect, obj, context, metadata);

                fiLateBindings.fiEditorGUI.PopHierarchyMode();
                return(result);
            }
Ejemplo n.º 3
0
            protected override T DoEdit(Rect rect, T obj, TContext context, fiGraphMetadata metadata)
            {
                float padding = rect.height - _centered.GetHeight(obj, context, metadata);

                rect.y      += padding / 2;
                rect.height -= padding;

                return(_centered.Edit(rect, obj, context, metadata));
            }
Ejemplo n.º 4
0
            protected override T DoEdit(Rect rect, T obj, TContext context, fiGraphMetadata metadata)
            {
                var left   = _left.GetCurrentValue(obj, context);
                var right  = _right.GetCurrentValue(obj, context);
                var top    = _top.GetCurrentValue(obj, context);
                var bottom = _bottom.GetCurrentValue(obj, context);

                rect.x      += left;
                rect.width  -= left + right;
                rect.y      += top;
                rect.height -= top + bottom;
                return(_control.Edit(rect, obj, context, metadata));
            }
Ejemplo n.º 5
0
            protected override T DoEdit(Rect rect, T obj, TContext context, fiGraphMetadata metadata)
            {
                var guiContent = GUIContent.GetCurrentValue(obj, context);

                Rect labelRect        = rect;
                Rect controlRect      = rect;
                bool pushedLabelWidth = false;

                if (_control != null && guiContent.IsEmpty == false)
                {
                    labelRect.height = fiLateBindings.EditorGUIUtility.singleLineHeight;

                    if (InlineControl)
                    {
                        labelRect.width    = fiGUI.PushLabelWidth(guiContent, labelRect.width);
                        pushedLabelWidth   = true;
                        controlRect.x     += labelRect.width;
                        controlRect.width -= labelRect.width;
                    }
                    else
                    {
                        var deltaY = labelRect.height + fiLateBindings.EditorGUIUtility.standardVerticalSpacing;
                        controlRect.x      += fiRectUtility.IndentHorizontal;
                        controlRect.width  -= fiRectUtility.IndentHorizontal;
                        controlRect.y      += deltaY;
                        controlRect.height -= deltaY;
                    }
                }

                if (guiContent.IsEmpty == false)
                {
                    var style          = fiLateBindings.EditorStyles.label;
                    var savedFontStyle = style.fontStyle;
                    style.fontStyle = _fontStyle;
                    GUI.Label(labelRect, guiContent, style);
                    style.fontStyle = savedFontStyle;
                }

                if (_control != null)
                {
                    _control.Edit(controlRect, obj, context, metadata);
                }

                if (pushedLabelWidth)
                {
                    fiGUI.PopLabelWidth();
                }

                return(obj);
            }
Ejemplo n.º 6
0
            protected override T DoEdit(Rect rect, T obj, TContext context, fiGraphMetadata metadata)
            {
                var foldout = GetMetadata(metadata);

                if (HierarchyMode.HasValue)
                {
                    fiLateBindings.fiEditorGUI.PushHierarchyMode(HierarchyMode.Value);
                }

                Rect foldoutRect = rect;

                foldoutRect.height = fiLateBindings.EditorGUIUtility.singleLineHeight;
                foldout.IsExpanded = fiLateBindings.EditorGUI.Foldout(foldoutRect, foldout.IsExpanded, _label, /*toggleOnLabelClick:*/ true, _foldoutStyle);

                if (foldout.IsExpanded)
                {
                    var delta = fiLateBindings.EditorGUIUtility.singleLineHeight + fiLateBindings.EditorGUIUtility.standardVerticalSpacing;

                    Rect controlRect = rect;
                    if (IndentChildControl)
                    {
                        controlRect.x     += fiRectUtility.IndentHorizontal;
                        controlRect.width -= fiRectUtility.IndentHorizontal;
                    }
                    controlRect.y      += delta;
                    controlRect.height -= delta;

                    obj = _control.Edit(controlRect, obj, context, metadata);
                }

                if (HierarchyMode.HasValue)
                {
                    fiLateBindings.fiEditorGUI.PopHierarchyMode();
                }

                return(obj);
            }
Ejemplo n.º 7
0
 protected override T DoEdit(Rect rect, T obj, TContext context, fiGraphMetadata metadata)
 {
     return(_control.Edit(rect, obj, context, metadata));
 }
Ejemplo n.º 8
0
 protected override TTo DoEdit(Rect rect, TTo obj, TContextTo context, fiGraphMetadata metadata)
 {
     return(Cast <TTo>(_control.Edit(rect, Cast <TFrom>(obj), Cast <TContextFrom>(context), metadata)));
 }