Editor.OnPreviewGUI 当预览GUI


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.

注意:检视面板预览仅限于永久对象(资源)的主编辑器。例如,GameObjectInspector、MaterialEditor、TextureInspector。这意味着它当前无法为一个组件有它自己的检视面板预览。


,