Vixen
dd8b0a81
csharp
public sealed class PrefabView

A prefab, open in isolation: a banner saying so, and the subtree it holds.

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

Remarks

The panel is PrefabView.vxml; this file is the accessibility modifier and the record its banner is made of. The emitter's partial carries no modifier, and the type is public.

The banner is the feature, not decoration. The failure an isolated prefab mode exists to prevent is somebody editing a prefab while believing they are editing a level — and every editor that has this mode marks it, because the two look identical otherwise. The banner also carries the one thing that is true here and nowhere else: this document must have exactly one root, and it says so the moment it does not.

⚠ The root count is checked as the structure changes and refused at the save. Refusing the edit that made a second root would mean an author cannot create an entity before parenting it. So the banner turns into a complaint, and PrefabFileWriter is what actually refuses — which is the moment work would otherwise be lost.

Fields and properties (8)

  • protected override string TagName
  • protected override bool AcceptsFocus

    Whether the focus can rest on this kind of control at all.

  • public Alert Banner

    The strip that says this is a prefab and not a level.

  • public UiElement Body

    Where the tree goes.

  • public Tabs Panes

    The two panes: the entities, and what a build makes of them.

  • public SceneHierarchyView? Hierarchy

    The tree over the prefab's entities.

  • public CompiledSceneView? Compiled

    What a build makes of this prefab, the one-root rule included.

  • public bool IsSavable

    Whether the prefab is in a state that can be saved.

Methods (3)

  • protected override void OnCreated()
  • protected override void OnRemoved()
  • public void Show(SceneDocument prefab)

    Shows a prefab.

Used by (1)

  • PrefabEditorFactoryVixen.Editor.AssetEditors