UnityEditor.DecoratorDrawer.GetHeight C# (CSharp) Method

GetHeight() public method

Override this method to specify how tall the GUI for this decorator is in pixels.

public GetHeight ( ) : float
return float
        public virtual float GetHeight()
        {
            return 16f;
        }

Usage Example

        public float GetHeight(SerializedProperty property, GUIContent label, bool includeChildren)
        {
            float num1 = 0.0f;

            if (this.m_DecoratorDrawers != null && !this.isCurrentlyNested)
            {
                using (List <DecoratorDrawer> .Enumerator enumerator = this.m_DecoratorDrawers.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        DecoratorDrawer current = enumerator.Current;
                        num1 += current.GetHeight();
                    }
                }
            }
            float num2;

            if (this.propertyDrawer != null)
            {
                num2 = num1 + this.propertyDrawer.GetPropertyHeightSafe(property.Copy(), label ?? EditorGUIUtility.TempContent(property.displayName));
            }
            else if (!includeChildren)
            {
                num2 = num1 + EditorGUI.GetSinglePropertyHeight(property, label);
            }
            else
            {
                property = property.Copy();
                SerializedProperty endProperty = property.GetEndProperty();
                num2 = num1 + EditorGUI.GetSinglePropertyHeight(property, label);
                bool enterChildren = property.isExpanded && EditorGUI.HasVisibleChildFields(property);
                while (property.NextVisible(enterChildren) && !SerializedProperty.EqualContents(property, endProperty))
                {
                    float num3 = num2 + ScriptAttributeUtility.GetHandler(property).GetHeight(property, EditorGUIUtility.TempContent(property.displayName), true);
                    enterChildren = false;
                    num2          = num3 + 2f;
                }
            }
            return(num2);
        }
All Usage Examples Of UnityEditor.DecoratorDrawer::GetHeight