Editor.OnPreviewGUI Manual     Reference     Scripting  
Scripting > Editor Classes > Editor
Editor.OnPreviewGUI

function OnPreviewGUI (r : Rect, background : GUIStyle) : void

Description

Implement this method in a subclass if you want to have a preview field in the inspector.

The overidden method should use the rectangle passed in and render a preview of the asset into it. The default implementation is a no-op.

Note: Inspector previews are limited to the primary editor of persistent objects (assets), e.g., GameObjectInspector, MaterialEditor, TextureInspector. This means that it is currently not possible for a component to have its own inspector preview.