Esempio n. 1
0
        public float GetItemHeight(int index)
        {
            var property = _valuesProperty.GetArrayElementAtIndex(index);

            switch (_itemDisplay)
            {
            case ListItemDisplayType.Normal:
            {
                return(EditorGUI.GetPropertyHeight(property));
            }

            case ListItemDisplayType.Inline:
            {
                using (new EditorGUI.IndentLevelScope(1))
                    return(RectHelper.LineHeight + InlineDisplayDrawer.GetHeight(property));
            }

            case ListItemDisplayType.Foldout:
            {
                using (new EditorGUI.IndentLevelScope(1))
                {
                    var expanded = IsExpanded(index);
                    return(expanded ? RectHelper.LineHeight + InlineDisplayDrawer.GetHeight(property) : EditorGUIUtility.singleLineHeight);
                }
            }

            case ListItemDisplayType.AssetPopup:
            {
                return(AssetPopupDrawer.GetHeight());
            }
            }

            return(0.0f);
        }
Esempio n. 2
0
        private float GetItemInlineHeight(int index)
        {
            var property = _property.GetArrayElementAtIndex(index);

            return(InlineDisplayDrawer.GetHeight(property));
        }