Hide
AssetPreview

Show an image preview for prefabs, Sprite, Texture2D, Addressable AssetReference, etc. (Internally use AssetPreview.GetAssetPreview), or on type.

Note: Recommended to use AboveImage/BelowImage for image/sprite/texture2D.

  • int width=-1

    preview width, -1 for original image size that returned by Unity. If it's greater than current view width, it'll be scaled down to fit the view. Use int.MaxValue to always fit the view width.

  • int height=-1

    preview height, -1 for auto resize (with the same aspect) using the width

  • EAlign align=EAlign.FieldStart

    Align of the preview image. Options are Start, End, Center, FieldStart

  • bool above=false

    if true, render above the field instead of below

  • string groupBy=""

    See the GroupBy section

  • Allow Multiple: No

using SaintsField; [AssetPreview(20, 100)] public Texture2D _texture2D; [AssetPreview(50)] public GameObject _go; [AssetPreview(above: true)] public Sprite _sprite;

asset_preview

If the target is a 3D model, materal etc, the previwe panel is interactive

using SaintsField; [AssetPreview] public GameObject prefabWithModel; [AssetPreview] public GameObject fbx; [AssetPreview] public Material drawMaterial;