コード例 #1
0
        public static void Draw(GUIContent label, SerializedProperty property, ClassDisplayType type)
        {
            var height = GetHeight(label, property, type);
            var rect   = EditorGUILayout.GetControlRect(false, height);

            Draw(rect, label, property, type);
        }
コード例 #2
0
 public NavTarget(string label, string link, ClassDisplayType classType, MenuItemType menuItemType)
 {
     Label        = label;
     Link         = link;
     ClassType    = classType;
     MenuItemType = menuItemType;
 }
コード例 #3
0
        private static readonly GUIContent _emptyContent = new GUIContent(" ");         // need a space to force drawing of the blank prefix label

        #region Static Interface

        public static float GetHeight(GUIContent label, SerializedProperty property, ClassDisplayType type)
        {
            if (type == ClassDisplayType.Inline || type == ClassDisplayType.Propogated)
            {
                return(GetHeightOfChildren(property));
            }
            else if (type == ClassDisplayType.Foldout && !property.isExpanded)
            {
                return(EditorGUIUtility.singleLineHeight);
            }
            else
            {
                using (new EditorGUI.IndentLevelScope())
                    return(RectHelper.LineHeight + GetHeightOfChildren(property));
            }
        }
コード例 #4
0
        public static void Draw(Rect position, GUIContent label, SerializedProperty property, ClassDisplayType type)
        {
            if (type == ClassDisplayType.Inline)
            {
                DrawChildren(position, property, null);
            }
            else if (type == ClassDisplayType.Propogated)
            {
                DrawChildren(position, property, label);
            }
            else if (type == ClassDisplayType.Foldout)
            {
                var labelRect = RectHelper.TakeLine(ref position);

                property.isExpanded = FoldoutSection.Draw(labelRect, label, property.isExpanded);

                if (property.isExpanded)
                {
                    using (new EditorGUI.IndentLevelScope())
                        DrawChildren(position, property, null);
                }
            }
            else
            {
                var labelRect = RectHelper.TakeLine(ref position);
                EditorGUI.LabelField(labelRect, label);

                using (new EditorGUI.IndentLevelScope())
                    DrawChildren(position, property, null);
            }
        }
コード例 #5
0
 public ClassDisplayAttribute(ClassDisplayType type) => Type = type;