Version 2.1.0.0

Odin has a dedicated attribute overview with examples

InlineEditorAttribute class

Namespace: Sirenix.OdinInspector
Assembly: Sirenix.OdinInspector.Attributes
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Parameter | AttributeTargets.Delegate | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter | AttributeTargets.All)]
public class InlineEditorAttribute : Attribute, _Attribute

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

Inheritance
  • System.Object
  • System.Attribute
  • InlineEditorAttribute
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;
}

Constructors

InlineEditorAttribute(InlineEditorModes, InlineEditorObjectFieldModes)
Initializes a new instance of the InlineEditorAttribute class.
public InlineEditorAttribute(InlineEditorModes inlineEditorMode = InlineEditorModes.GUIOnly, InlineEditorObjectFieldModes objectFieldMode = InlineEditorObjectFieldModes.Boxed)
Parameters
InlineEditorModes inlineEditorMode

The inline editor mode.

InlineEditorObjectFieldModes objectFieldMode

How the object field should be drawn.

InlineEditorAttribute(InlineEditorObjectFieldModes)
Initializes a new instance of the InlineEditorAttribute class.
public InlineEditorAttribute(InlineEditorObjectFieldModes objectFieldMode)
Parameters
InlineEditorObjectFieldModes objectFieldMode

How the object field should be drawn.

Fields

DrawGUI
Draw editor GUI inline.
public bool DrawGUI
DrawHeader
Draw the header editor header inline.
public bool DrawHeader
DrawPreview
Draw editor preview inline.
public bool DrawPreview
Expanded
If true, the inline editor will start expanded.
public bool Expanded
IncrementInlineEditorDrawerDepth
If false, this will prevent the InlineEditor attribute from incrementing the InlineEditorAttributeDrawer.CurrentInlineEditorDrawDepth. This is helpful in cases where you want to draw the entire editor, and disregard attributes such as [HideInInlineEditorsAttribute] and [DisableInInlineEditorsAttribute].
public bool IncrementInlineEditorDrawerDepth
MaxHeight
Maximum height of the inline editor. If the inline editor exceeds the specified height, a scrollbar will appear. Values less or equals to zero will let the InlineEditor expand to its full size.
public float MaxHeight
ObjectFieldMode
How the InlineEditor attribute drawer should draw the object field.
public InlineEditorObjectFieldModes ObjectFieldMode
PreviewHeight
The size of the editor preview if drawn alone.
public float PreviewHeight
PreviewWidth
The size of the editor preview if drawn together with GUI.
public float PreviewWidth