diff --git a/Assets/NaughtyAttributes/Scripts/Editor/PropertyDrawers/ShowAssetPreviewPropertyDrawer.cs b/Assets/NaughtyAttributes/Scripts/Editor/PropertyDrawers/ShowAssetPreviewPropertyDrawer.cs index 12c27c46..cdd203e0 100644 --- a/Assets/NaughtyAttributes/Scripts/Editor/PropertyDrawers/ShowAssetPreviewPropertyDrawer.cs +++ b/Assets/NaughtyAttributes/Scripts/Editor/PropertyDrawers/ShowAssetPreviewPropertyDrawer.cs @@ -72,6 +72,13 @@ private Texture2D GetAssetPreview(SerializedProperty property) if (property.objectReferenceValue != null) { Texture2D previewTexture = AssetPreview.GetAssetPreview(property.objectReferenceValue); + + if (previewTexture == null && property.objectReferenceValue is Component) + { + var gameObject = (property.objectReferenceValue as Component).gameObject; + previewTexture = AssetPreview.GetAssetPreview(gameObject); + } + return previewTexture; }