Skip to content

Commit 34baad5

Browse files
committed
Fix AssetPreview height for targets without the preview texture
1 parent 2dce469 commit 34baad5

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Assets/Editor Toolbox/Editor/Drawers/Regular/AssetPreviewAttributeDrawer.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ private void DrawAssetPreview(Rect rect, Texture2D previewTexture)
5656

5757
protected override float GetPropertyHeightSafe(SerializedProperty property, GUIContent label)
5858
{
59-
//return native height
60-
if (!property.objectReferenceValue)
59+
var target = property.objectReferenceValue;
60+
var previewTexture = AssetPreview.GetAssetPreview(target);
61+
if (previewTexture == null)
6162
{
6263
return base.GetPropertyHeightSafe(property, label);
6364
}

0 commit comments

Comments
 (0)