Inline Editor Attribute

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

[InlineEditor] public ExampleTransform InlineComponent; [InlineEditor(InlineEditorModes.FullEditor)] public Material FullInlineEditor; [InlineEditor(InlineEditorModes.GUIAndHeader)] public Material InlineMaterial; [InlineEditor(InlineEditorModes.SmallPreview)] public Material[] InlineMaterialList; [InlineEditor(InlineEditorModes.LargePreview)] public Mesh InlineMeshPreview; // You can also use the InlineEditor attribute directly on a class definition itself! //[InlineEditor] //public class ExampleTransform : ScriptableObject //{ // public Vector3 Position; // public Quaternion Rotation; // public Vector3 Scale = Vector3.one; //} [OnInspectorInit] private void CreateData() { InlineComponent = ExampleHelper.GetScriptableObject<ExampleTransform>("Inline Component"); FullInlineEditor = ExampleHelper.GetMaterial(); InlineMaterial = ExampleHelper.GetMaterial(); InlineMaterialList = new Material[] { ExampleHelper.GetMaterial(), ExampleHelper.GetMaterial(), ExampleHelper.GetMaterial(), }; InlineMeshPreview = ExampleHelper.GetMesh(); } [OnInspectorDispose] private void CleanupData() { if (InlineComponent != null) Object.DestroyImmediate(InlineComponent); }