示例#1
0
        public void LayoutDrawUnwind(Rect rect, EditorGUILayoutState state)
        {
            if (state.ShouldUseVisibility())
            {
                if (Event.current.type == EventType.Repaint)
                {
                    Rect new_visible_rect = GUIUtilityExtensions.GetVisibleRect();

                    if (new_visible_rect.height <= Screen.height && new_visible_rect.height >= 16.0f)
                    {
                        visible_rect = new_visible_rect;
                    }
                }
            }
            else
            {
                visible_rect = rect;
            }

            if (rect.width > 16.0f)
            {
                int draw_id = next_draw_id++;

                element.Plan(rect.width, state);
                element.Layout(rect.min);

                element.Draw(draw_id, visible_rect);
                element.Unwind(draw_id);
            }
        }
示例#2
0
 static public EditorGUILayoutState GetWithShouldAlwaysShowRecoveryFields(this EditorGUILayoutState item, bool should)
 {
     return(new EditorGUILayoutState(
                item.GetCurrentLabelWidth(),
                item.ShouldAutoSizeLabels(),
                item.GetAutoSizeLabelMargin(),
                item.ShouldUseVisibility(),
                should
                ));
 }
示例#3
0
 static public EditorGUILayoutState GetWithCurrentLabelWidth(this EditorGUILayoutState item, float width)
 {
     return(new EditorGUILayoutState(
                width,
                item.ShouldAutoSizeLabels(),
                item.GetAutoSizeLabelMargin(),
                item.ShouldUseVisibility(),
                item.ShouldAlwaysShowRecoveryFields()
                ));
 }