Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


MeshPreview

Use this class to render an interactive preview of a mesh.
Read time 1 minuteLast updated 5 days ago

Definition

public class MeshPreview : IDisposable

Remarks

Use this class from an ObjectPreview or Editor.OnPreviewGUI to render an interactive mesh preview.

Constructors

Constructor

Description

MeshPreview(UnityEngine.Mesh)Creates a new MeshPreview instance with a Mesh target.

Properties

Property

Description

meshThe Mesh to display in the preview space.

Methods

Method

Description

DisposeReleases allocated resources associated with this object.
OnPreviewGUICall this from an Editor.OnPreviewGUI or ObjectPreview.OnPreviewGUI to draw a mesh preview.
OnPreviewSettingsCall this from Editor.OnPreviewSettings() or ObjectPreview.OnPreviewSettings to draw additional settings related to the mesh preview.
RenderStaticPreviewCreates a texture preview to override Editor.RenderStaticPreview. The current MeshPreview.mesh will be drawn.

Static Methods

Method

Description

GetInfoStringReturns a short summary of the Mesh attributes (ex, does this mesh contain positions, normals, tangents, etc...).