public float GetElementHeight(MightySerializedField serializedField, int index, BasePropertyDrawerAttribute baseAttribute) { var propertyType = serializedField.GetElement(index).propertyType; return(propertyType != SerializedPropertyType.Integer && propertyType != SerializedPropertyType.Float ? MightyGUIUtilities.WARNING_HEIGHT : MightyGUIUtilities.FIELD_HEIGHT + MightyGUIUtilities.FIELD_SPACING); }
public float GetElementHeight(MightySerializedField serializedField, int index, BasePropertyDrawerAttribute baseAttribute) { var element = serializedField.GetElement(index); return(element.propertyType != SerializedPropertyType.String ? MightyGUIUtilities.WARNING_HEIGHT : MightyGUIUtilities.TextHeight(element.stringValue, 3) + MightyGUIUtilities.FIELD_HEIGHT + MightyGUIUtilities.FIELD_SPACING * 2); }
public float GetElementHeight(MightySerializedField serializedField, int index, BasePropertyDrawerAttribute baseAttribute) { var element = serializedField.GetElement(index); return(element.propertyType != SerializedPropertyType.ObjectReference ? MightyGUIUtilities.WARNING_HEIGHT : !AssetPreview.GetAssetPreview(element.objectReferenceValue) ? MightyGUIUtilities.FIELD_HEIGHT + MightyGUIUtilities.FIELD_SPACING : 64); }
protected override float GetDecoratorHeight(MightySerializedField serializedField, int index, ShowAssetPreviewAttribute attribute) { var element = serializedField.GetElement(index); Texture2D preview; if (element.propertyType != SerializedPropertyType.ObjectReference || element.objectReferenceValue == null || (preview = AssetPreview.GetAssetPreview(element.objectReferenceValue)) == null) { return(40); } return(GetClampedWidthAndHeight(preview.width, preview.height, attribute.Size).Item2 + MightyGUIUtilities.FIELD_SPACING); }
public void DrawElement(GUIContent label, MightySerializedField serializedField, int index, BasePropertyDrawerAttribute baseAttribute) => DrawRotation2D(serializedField.GetElement(index), (Rotation2DAttribute)baseAttribute, label);
public void DrawElement(Rect position, MightySerializedField serializedField, int index, BasePropertyDrawerAttribute baseAttribute) => DrawAssetField(position, serializedField.GetElement(index), (AssetOnlyAttribute)baseAttribute);
public void DrawElement(GUIContent label, MightySerializedField serializedField, int index, BasePropertyDrawerAttribute baseAttribute) => DrawAssetField(serializedField.GetElement(index), (AssetOnlyAttribute)baseAttribute, label);
public float GetElementHeight(MightySerializedField serializedField, int index, BasePropertyDrawerAttribute attribute) => IsPropertyTypeValid(serializedField.GetElement(index).propertyType) ? GetFieldHeight(attribute.Options) : MightyGUIUtilities.WARNING_HEIGHT;
public void DrawElement(Rect position, MightySerializedField serializedField, int index, BasePropertyDrawerAttribute baseAttribute) => DrawField(position, serializedField.GetElement(index), baseAttribute.Options);
public void DrawElement(Rect position, MightySerializedField serializedField, int index, BasePropertyDrawerAttribute baseAttribute) => DrawSlider(position, serializedField.GetElement(index), (PercentSliderAttribute)baseAttribute);
public void DrawElement(MightySerializedField serializedField, int index, BasePropertyDrawerAttribute baseAttribute) => DrawLayerField(serializedField.GetElement(index), (LayerFieldAttribute)baseAttribute);
public void DrawElement(MightySerializedField serializedField, int index, BasePropertyDrawerAttribute baseAttribute) => DrawTagField(serializedField.GetElement(index), baseAttribute.Options);
protected override void DrawDecoratorElement(MightySerializedField serializedField, int index, ShowAssetPreviewAttribute attribute) => DrawPreview(serializedField.GetElement(index), attribute);
protected override Rect DrawDecoratorElement(Rect position, MightySerializedField serializedField, int index, ShowAssetPreviewAttribute attribute) => DrawPreview(position, serializedField.GetElement(index), attribute);
public void DrawElement(Rect position, MightySerializedField serializedField, int index, BasePropertyDrawerAttribute baseAttribute) => DrawRotation2D(position, serializedField.GetElement(index), (Rotation2DAttribute)baseAttribute);
public void DrawElement(GUIContent label, MightySerializedField serializedField, int index, BasePropertyDrawerAttribute baseAttribute) => DrawField(serializedField.GetElement(index), baseAttribute.Options, label);
public float GetElementHeight(MightySerializedField serializedField, int index, BasePropertyDrawerAttribute baseAttribute) => serializedField.GetElement(index).propertyType != SerializedPropertyType.Quaternion ? MightyGUIUtilities.WARNING_HEIGHT : MightyGUIUtilities.FIELD_HEIGHT + MightyGUIUtilities.FIELD_SPACING;
public void DrawElement(GUIContent label, MightySerializedField serializedField, int index, BasePropertyDrawerAttribute baseAttribute) => DrawSlider(serializedField.GetElement(index), (PercentSliderAttribute)baseAttribute, label);