Vixen
02b45cc4
csharp
public sealed class NestedDrawer

A member whose own type has members: drawn as a foldout of rows.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

The reason an inspector stops at one level otherwise. A component holding a Bounds, a settings object holding a nested block of options, a material holding a sampler description — each was previously one line of ToString from ReadOnlyDrawer, which is the last resort saying it has nothing better.

⚠ Only a class, and that is the generator's rule rather than this drawer's. VXI0103 refuses [Inspector] on a member of a value type, because InspectorMember<TOwner, TValue> constrains its owner to a class — so a struct never has a descriptor and this drawer never claims one. What that costs is real and is worth naming: a Bounds, a Rect or a settings block declared as a struct is still drawn by the last resort. Lifting it means a boxed owner and a write-back through the outer member, which is a change to the descriptor layer rather than to a drawer.

Because the member is a reference, the child rows edit the object itself and are handed the document — so the edit is undoable under the nested type's own name rather than as a replacement of the whole object.

⚠ Depth is bounded. A type that contains itself — directly, or through two types that name each other — would otherwise build rows until the stack ran out, at the moment somebody selected one.

Fields and properties (2)

  • public const int MaxDepth

    How far down a chain of nested types the rows are built.

  • public DrawerRegistry? Drawers

    Which drawer edits which member, for the rows this builds.

Methods (3)

Used by (2)

  • CompositeTestsVixen.Editor.Inspector.Tests
  • DrawerRegistryVixen.Editor.Inspector