AssetPreview.GetAssetPreview

Apologies for double posting (in editor section), but I suspect scripting gets more traffic, and I guess its kind of scripting as well… so (feel free to delete/lock other thread mods)

Anyone have a version of this working under U5?

Finally got into doing some Editor scripts, but nothing I’ve tried seems to work, even the horrid Thread.Sleep solutions you see scattered around the net.

Any tips appreciated.

to add further info, this works if I have a mesh selected in the project hierarchy.

If I have a prefab selected though, it wont show a preview (you can see a preview in the Unity preview window, so im guessing its possible)

    void OnGUI()
    {
       Texture2D preview = AssetPreview.GetAssetPreview(UnityEditor.Selection.activeGameObject);

        GUILayout.Box(preview, GUILayout.Width(200), GUILayout.Height(200));
   }