- Home /
Override Asset Preview Thumbnail
I'm looking for a way to change the icon which is currently visible for an asset on the Object Picker field.
I've created a CustomEditor for my class and overridden the "RenderStaticPreview" method, which does change the icon in the project view:
However, the thumbnail on the object picker is still displaying the default value:
Is this a bug, or is there another method which handles the drawing of the thumbnail?
Update: It appears this issue also occurs in the project view when the slider is used to shrink the icon to the smallest size. At this point the "RenderStaticPreview" method doesn't receive a callback either.
From watching a better programmer review the source code, it appears an entirely different method is called when it has to render the icon size below a certain threshold in the project view. (the 16x16 icon) so it'll alternate from unity's default icon to the custom icon when scrubbing between the icon sizes with the editor's scrollbar.
Answer by duongquangnam · Aug 03, 2018 at 04:04 PM
Hi. @Mako-Infused. You can write CustomEditor for this ScriptableObject and override function RenderStaticPreview. It returns Texture2D. https://answers.unity.com/questions/1003710/how-to-use-renderstaticpreview-with-a-user-defined.html
Yes, I had mentioned this method in my question, however the issue here is the inconsistency of that methods implementation. I'm looking for another way to do this, but thanks.