Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


OnInteractivePreviewGUI(Rect, GUIStyle)

Implement to create your own interactive custom preview. Interactive custom previews are used in the preview area of the inspector and the object selector.
Read time 1 minuteLast updated 6 days ago

Definition

  • Type: Method
  • Namespace: UnityEditor
  • Assembly: UnityEditor
public virtual void OnInteractivePreviewGUI(Rect r, GUIStyle background)

Parameters

Rectangle in which to draw the preview.

background

Background image.

Remarks

Implement this instead of ObjectPreview.OnPreviewGUI if you only want to display interactive custom previews (you can implement both if some previews are interactive and others aren't). 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.