---
description: https://odininspector.com/attributes/inline-editor-attribute
---

# Inline Editor

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

![](https://2759500209-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsgcgdrqBsTRcKQpieOux%2Fuploads%2FLb4SaneY9ZcVoLS4LwCT%2Fimage.png?alt=media\&token=145d9f7e-5958-44a5-a448-110ded783180)

```csharp
[Title("Boxed / Default")]
[InlineEditor(InlineEditorObjectFieldModes.Boxed)]
public ExampleTransform Boxed;

[Title("Foldout")]
[InlineEditor(InlineEditorObjectFieldModes.Foldout)]
public ExampleTransform Foldout;

[Title("Hide ObjectField")]
[InlineEditor(InlineEditorObjectFieldModes.CompletelyHidden)]
public ExampleTransform CompletelyHidden;

[Title("Show ObjectField if null")]
[InlineEditor(InlineEditorObjectFieldModes.Hidden)]
public ExampleTransform OnlyHiddenWhenNotNull;

[OnInspectorInit]
private void CreateData()
{
    Boxed = ExampleHelper.GetScriptableObject<ExampleTransform>("Boxed");
    Foldout = ExampleHelper.GetScriptableObject<ExampleTransform>("Foldout");
    CompletelyHidden = ExampleHelper.GetScriptableObject<ExampleTransform>("Completely Hidden");
    OnlyHiddenWhenNotNull = ExampleHelper.GetScriptableObject<ExampleTransform>("Only Hidden When Not Null");
}

[OnInspectorDispose]
private void CleanupData()
{
    if (Boxed != null) Object.DestroyImmediate(Boxed);
    if (Foldout != null) Object.DestroyImmediate(Foldout);
    if (CompletelyHidden != null) Object.DestroyImmediate(CompletelyHidden);
    if (OnlyHiddenWhenNotNull != null) Object.DestroyImmediate(OnlyHiddenWhenNotNull);
}
```
