Vixen
feb85697
csharp
public sealed class OverlayAttribute

Marks a static method as a panel floating over the scene pane.

Read the guide page for this →

As a annotation

Valid on
Method

Remarks

Doc 36 § D3. The method is what Build takes: it is handed a host element and the pane, and fills the first for the second.

[Overlay("Snapping", Corner = OverlayCorner.BottomLeft)] public static void Build(UiElement host, IViewportPane pane) { … }

⚠ A static method rather than a class, unlike Unity's [Overlay]. Unity's goes on an Overlay subclass because the base carries the docking state, the collapsed state and the display name. Ours has no base: an overlay is an Action<UiElement, IViewportPane>, its title is on the attribute, and where it sits is Corner. Same reasoning as CustomInspectorAttribute, and it matches the rest of the set.

⚠ Read two ways: by a scan of the assembly that declared it, for a plugin or a project script — see CustomInspectorAttribute for why that is bounded rather than the assembly scanning ADR-002 refuses — and, in-tree, by the generated Declared.Register.

The header's words are a declaration when there is a catalogue (#1284): Title names a StringId exactly as EditorMenuAttribute.Title does, and without one the header says Text.

Fields and properties (6)

  • public string Text

    What its header says when Title names no declaration.

  • public string Title

    The header's words, as the name of a StringId in a declaration class, or empty.

  • public Type? Strings

    The declaration class Title is in, when it is not this assembly's.

  • public OverlayCorner Corner

    Where it sits.

  • public string Id

    Its id, or empty to derive one from Text.

  • public int Order

    Where among the overlays sharing a corner, low first.

Methods (1)

  • public OverlayAttribute(string text)

    Marks a static method as a panel floating over the scene pane.

Used by (1)

  • DeclaredContributionsVixen.Editor.App