示例#1
0
        protected override void OnFieldsGUI(Rect position)
        {
            base.OnFieldsGUI(position);

            if (typeMetadata.value != null && ValueInput.SupportsDefaultValue((Type)typeMetadata.value))
            {
                y += EditorGUIUtility.standardVerticalSpacing;

                OnHasDefaultValueGUI(position.VerticalSection(ref y, GetHasDefaultValueHeight(position.width)));

                if ((bool)hasDefaultValueMetadata.value)
                {
                    y += EditorGUIUtility.standardVerticalSpacing;

                    OnDefaultValueGUI(position.VerticalSection(ref y, GetDefaultValueHeight(position.width)));
                }
            }
        }
示例#2
0
        protected override float GetHeight(float width, GUIContent label)
        {
            var height = base.GetHeight(width, label);

            if (typeMetadata.value != null && ValueInput.SupportsDefaultValue((Type)typeMetadata.value))
            {
                height += EditorGUIUtility.standardVerticalSpacing;

                height += GetHasDefaultValueHeight(width);

                if ((bool)hasDefaultValueMetadata.value)
                {
                    height += EditorGUIUtility.standardVerticalSpacing;

                    height += GetDefaultValueHeight(width);
                }
            }

            return(height);
        }