ObjectPreview

class in UnityEditor

Cambiar al Manual

Descripción

Base Class to derive from when creating Custom Previews.

You specify which type is the preview for, by using the ObjectPreview attribute. Below you can see an small example that will display the name of the object being inspected.

[CustomPreview(typeof(GameObject))]
public class MyPreview : ObjectPreview
{
    public override bool HasPreviewGUI()
    {
        return true;
    }

public override void OnPreviewGUI(Rect r, GUIStyle background) { GUI.Label(r, target.name + " is being previewed"); } }

Variables

targetThe object currently being previewed.

Funciones Públicas

DrawPreviewThis is the first entry point for Preview Drawing.
GetInfoStringImplement this method to show object information on top of the object preview.
GetPreviewTitleAnule este método si desea cambiar la etiqueta del área de vista previa.
HasPreviewGUISe puede previsualizar este componente en su estado actual?
InitializeCalled when the Preview gets created with the objects being previewed.
MoveNextTargetCalled to iterate through the targets, this will be used when previewing more than one target.
OnInteractivePreviewGUIImplemente para crear su propia vista previa personalizada interactiva. Las vistas previas interactivas personalizadas se utilizan en el área de vista previa del inspector y el selector de objetos.
OnPreviewGUIImplemente para crear su propia vista previa personalizada para el área de vista previa del inspector, los encabezados del editor principal y el selector de objetos.
OnPreviewSettingsAnule este método si desea mostrar controles personalizados en el encabezado de la vista previa.
ResetTargetCalled to Reset the target before iterating through them.