InlineEditorAttribute

InlineAttribute is used on any property or field with a type that inherits from UnityEngine.Object. This includes components and assets etc.

namespace Sirenix.OdinInspector
{
[AttributeUsageAttribute((AttributeTargets)384)]
public class InlineEditorAttribute : Attribute
}

Requirements

Namespace: Sirenix.OdinInspector
Assembly: Sirenix.OdinInspector
Version: 1.0.4.1

See Also

Fields

Return Type Definition Description
bool DrawGUI Draw editor GUI inline.
bool DrawHeader Draw the header editor header inline.
bool DrawPreview Draw editor preview inline.
bool Expanded If true, the inline editor will start expanded.
bool IncrementInlineEditorDrawerDepth If false, this will prevent the InlineEditor attribute from incrementing the InlineEditorAttributeDrawer.CurrentInlineEditorDrawDepth. This is helpfull in cases where you want to draw the entire editor, and disreguard attributes such as [ HideInInlineEditorsAttribute] and [ DisableInInlineEditorsAttribute].
float PreviewHeight The size of the editor preview if drawn alone.
float PreviewWidth The size of the editor preview if drawn together with GUI.

Constructors

Definition Description
InlineEditorAttribute(InlineEditorModes) Initializes a new instance of the InlineEditorAttribute class.

Example

public class InlineEditorExamples : MonoBehaviour
{
    [DisableInInlineEditors]
    public Vector3 DisabledInInlineEditors;
   
    [HideInInlineEditors]
    public Vector3 HiddenInInlineEditors;
   
    [InlineEditor]
    public Transform InlineComponent;

    [InlineEditor(InlineEditorModes.FullEditor)]
    public Material FullInlineEditor;

    [InlineEditor(InlineEditorModes.GUIAndHeader)]
    public Material InlineMaterial;

    [InlineEditor(InlineEditorModes.SmallPreview)]
    public Material[] InlineMaterialList;

    [InlineEditor(InlineEditorModes.LargePreview)]
    public GameObject InlineObjectPreview;

    [InlineEditor(InlineEditorModes.LargePreview)]
    public Mesh InlineMeshPreview;
}