Vixen
02b45cc4
csharp
public sealed class SceneEntity

One entity, as a row of editors and as something the gizmo can drag.

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

Remarks

The join, and the reason it lives in the application. An entity is a handle and a set of chunk rows; an inspector shows the members of an object. Something has to be that object. Putting it here rather than in either library is what keeps Vixen.Editor.Inspector from knowing what an ECS is and Vixen.Editor.SceneView from knowing what a property drawer is — and it is the same class a game team would write to put their own components in the inspector.

It is also the gizmo's target, deliberately. One type behind both means a drag and a typed number cannot disagree about what "position" is, and the inspector following a drag is InspectorView.Reload reading the same three properties the gizmo just wrote.

⚠ Nothing is cached. Every read goes to the chunk and every write goes to the chunk. Two of these over one entity therefore cannot disagree, and an entity a script moved mid-drag is seen rather than overwritten. What it costs is a component lookup per property access, which against a selection somebody is looking at is not a cost.

⚠ A dead entity reads as defaults and refuses writes. A selection outlives the thing it names — a play-mode restore reissues every handle — and an inspector that threw while drawing a row would take the editor down for the rest of the session.

Fields and properties (6)

  • public Entity Entity

    The entity being shown.

  • public bool IsAlive

    Whether the entity is still there.

  • public string Name

    What it is called.

  • public Vector3 Position

    Where it is, in world space.

  • public Quaternion Rotation

    How it is turned, in world space.

  • public Vector3 Scale

    How big it is, relative to its parent.

Methods (2)

  • public SceneEntity(SceneDocument document, Entity entity)

    Views an entity.

  • public override string ToString()

    Renders it as its name.

Used by (3)

  • Describes_Vixen_Editor_App_SceneEntityVixen.Editor.App
  • EditorApplicationVixen.Editor.App
  • SelectionTestsVixen.Editor.App.Tests