Search Unity

Caching a generated Texture2D AssetPreview in editor

Discussion in 'Editor & General Support' started by Roryyyyyyyyyy, Jan 3, 2019.

  1. Roryyyyyyyyyy

    Roryyyyyyyyyy

    Joined:
    Jun 8, 2015
    Posts:
    22
    Hi, in my custom editor window I have an overview which shows a preview of every prefab of a certain type, problem is, the AssetPreview.GetAssetPreview is causing some pretty horrendous stutters.

    I am trying to store the preview for each prefab but in editor, setting the public Texture2D just gives a type mismatch and not storing the texture.

    I'm sure there is probably a different way of doing this in editor, I was wondering if anyone could give me a pointer to a better way to do this?