/// <summary> /// Draw an property field with an asset preview below it. /// </summary> /// <param name="_property">Property to display and draw asset preview.</param> /// <param name="_label">Displayed label.</param> /// <param name="_foldout">The shown asset preview foldout state.</param> /// <param name="_previewAspect">Aspect of the displayed asset preview.</param> /// <returns>Returns new asset preview foldout state.</returns> public static bool AssetPreviewField(SerializedProperty _property, GUIContent _label, bool _foldout, float _previewAspect) { Rect _rect = EditorGUILayout.GetControlRect(true, EditorGUIUtilityEnhanced.GetAssetPreviewPropertyHeight(_property, _foldout, _previewAspect)); return(EditorGUIEnhanced.AssetPreviewField(_rect, _property, _label, _foldout)); }
/*************************** ******* METHODS ******* **************************/ // Specify how tall the GUI for this decorator is in pixels public override float GetPropertyHeight(SerializedProperty _property, GUIContent _label) { AssetPreviewAttribute _attribute = (AssetPreviewAttribute)attribute; return(EditorGUIUtilityEnhanced.GetAssetPreviewPropertyHeight(_property, _attribute.Fodlout, _attribute.Aspect)); }